UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


guides:interrupt_driven_rtty

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guides:interrupt_driven_rtty [2014/04/12 13:44] ibanezmatt13guides:interrupt_driven_rtty [2015/02/03 13:43] (current) danielrichman
Line 4: Line 4:
  
  
-{{ :guides:881951_721113604583622_1292041006_o.jpg?700x500 }}+{{ :guides:881951_721113604583622_1292041006_o.jpg?700x500 | NORB 3 tracker PCB }}
  
  
Line 11: Line 11:
  
 There are many types of interrupt, and each type can be triggered in a certain way, details of which can be found in the interrupt vectors section of any AVR datasheet. An interrupt can be triggered by a pin being pulled low, or perhaps each time an external oscillator ticks, or in many other ways that are described in the datasheet. In this example, we will be focusing on using a software based timer interrupt using the popular ATMEGA328P, a chip used on many Arduino platforms. I will assume prior knowledge of the RTTY (radio teletype) radio mode. There are many types of interrupt, and each type can be triggered in a certain way, details of which can be found in the interrupt vectors section of any AVR datasheet. An interrupt can be triggered by a pin being pulled low, or perhaps each time an external oscillator ticks, or in many other ways that are described in the datasheet. In this example, we will be focusing on using a software based timer interrupt using the popular ATMEGA328P, a chip used on many Arduino platforms. I will assume prior knowledge of the RTTY (radio teletype) radio mode.
 +
 +
  
  
Line 52: Line 54:
           sentence_needed = false;           sentence_needed = false;
           digitalWrite(LED_1, LOW);           digitalWrite(LED_1, LOW);
 +          // warning! The lack of "break" in this branch means that we
 +          // fall through to "case 1" immediately, in order to start
 +          // sending the start bit.
         }         }
         else {         else {
Line 141: Line 146:
 Firstly, you must understand that we are using 7 bit ASCII. ASCII is one of the common ways of encoding all the 128 characters we typically use. It gives each character a value which is comprised of so many bits. There’s 7 bit ASCII and 8 bit ASCII, though here we’ll be using 7 bit ASCII. So you understand now that the radio transmitter must transmit each bit at a time. Firstly, you must understand that we are using 7 bit ASCII. ASCII is one of the common ways of encoding all the 128 characters we typically use. It gives each character a value which is comprised of so many bits. There’s 7 bit ASCII and 8 bit ASCII, though here we’ll be using 7 bit ASCII. So you understand now that the radio transmitter must transmit each bit at a time.
  
-If the interrupt fires every 20ms, you will understand that we can’t possibly send more than one bit per routine as this would just register as a longer bit, making no sense to the way in which RTTY works. This means that we will have different conditions in which the routine will operate differently. We can mark each condition by having a status variable which will change depending on when the condition for transmission needs to be updated. Above, this variable is marked tx_status, and it’s different conditions are described below:+If the interrupt fires every 20ms, you will understand that we can’t possibly send more than one bit per routine as this would just register as a longer bit, making no sense to the way in which RTTY works. This means that we will have different conditions in which the routine will operate differently. We can mark each condition by having a status variable which will change depending on when the condition for transmission needs to be updated. Above, this variable is marked tx_status, and its different conditions are described below:
  
  
Line 176: Line 181:
  
  
-And there you have it, one fully functional example of interrupt driven 50 baud RTTY, full explained. The code in this example of course is only a demonstration and is not a complete program in itself. However, it’s the little guides like this that make you stitch each piece of knowledge together into a structure so valuable and so close to you that, you’ll be far more satisfied with what you achieve in your HAB endeavors. Time I had a cup of tea and a biscuit, good luck!+And there you have it, one fully functional example of interrupt driven 50 baud RTTY, fully explained. The code in this example of course is only a demonstration and is not a complete program in itself. However, it’s the little guides like this that provide opportunity for you to stitch each piece of knowledge together into a structure that, in time, you’ll be far more satisfied with in your HAB endeavors. Time I had a cup of tea and a biscuit, good luck!
  
  
guides/interrupt_driven_rtty.1397310277.txt.gz · Last modified: 2014/04/12 13:44 by ibanezmatt13

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki