Step 63: Software: RS-232 input

Picture of Software: RS-232 input

To generate the most awesome effects, we use a desktop computer. Computers can do floating point calculations and stuff like that much quicker than a micro controller. And you don't have to re-program the micro controller for every effect you make, or every time you want to test or debug something.

The USART interface in the ATmega is configured to work at 38400 baud with one stop bit and no parity. Each byte that is sent down the line has a start bit and a stop bit, so 10 bits is sent to transmit 8 bits. This gives us a bandwidth of 3840 bytes per second. The cube buffer is 64 bytes. Syncing bytes make up 2 bytes per cube frame. At 38400 baud we are able to send about 58 frames per second. More than enough for smooth animations.

0xff is used as an escape character, and puts the rs232 function into escape mode. If the next byte is 0x00, the coordinates for the buffer are restored to 0,0. If the next byte is 0xff, it is added to the buffer. To send 0xff, you simply send it twice.

The rs232 function just loops forever. A reset is needed to enter the cube's autonomous mode again.

Remove these adsRemove these ads by Signing Up
mnopamin1 year ago

how can i change baud rate to 9600????????

Are these programs compatible with Mac's? If so where could I get them?
To generate the most awesome effects i need to download the pc software! who can tell me how can i to use the PC software to control the cube,the pc software includes many files,which file is the pc software and how does it to control the com port! thanks
Vick Jr4 years ago
Question: Is there any advantage to this setup over the one used here which seems to control the cube directly with a parallel port with no IC interpreter?