Week 8 Embedded Programing

 

For this week assignment at Kuwait Fab Lab ,  I will use hello world board as an output of data coming from a serial port . First I started writing code for my assignment. At the beginning I used serial code from the hello.bus and it worked , but I want to have a RX buffer also to have a function to make sure if there is data at the serial port , so I modify my library to use input interrupts after when the state of the RX pin changes, an interrupt increases , so I am able to check for the start bit, read the input data, and save it in the buffer. Then a serial_available() function must be checked for bytes stored in the buffer to know if we have something ready to read.

After for the morse code, there is a lookup table which translates dots and dashes to bytes. The idea if the LSB of that number is 1, dash,  also if it's 0 dot, then divide the number by two and repeat until we got integer 1 and stop. Also for For spacing and timing, morse code convention is used, speed is in words per minute (WPM), so length of a dot is 1200/WPM, lenght of a dash is 3*dot, space between symbols is equal to one dot, space between letters is equal to three dots and between words is equal to seven dots.

 
 

 

* Files :

1
2