Project:
For this week, I used my motor controller board and wrote a general serial interface for connecting to the board. To test the serial interface, I made a little python program to talk serial to the device. The serial protocol consists of simple read and write commands for accessing a virtual memory block inside the micro.
Serial Protocol:
The serial protocol consists of read and write commands and uses a simple packet frame:
Write: [start char] [Address (00-FF)] [data (0000-FFFF)] [truncated checksum (00-FF)]
Read: [start char] [Address (00-FF)] [truncated checksum (00-FF)]
Return: [start char] [Address (00-FF)] [data (0000-FFFF)] [truncated checksum (00-FF)]
Learned:
- Stk500 is pretty much the only programming option for Ubuntu under VM (spent 4 hours almost but not getting mkII to work...)
To do:
- Finish the motor part of the motor controller board
- Put in way to save memory to EEPROM
- Write small ui for tweaking and saving settings through the serial interface
![](images/week5_fig3.jpg)
Board shown being programmed by Atmel SDK500 and interfaced through an FTDI USB to serial converter.
![](images/week5_fig4.jpg)
Programming the board using a toolchain of: text editor > avr-gcc > avrdude - make clean > make > make install %E2%80%93 so simple and powerful%E2%80%A6.
![](images/week5_fig5.jpg)
Screenshot of little pyqt program for testing the serial interface. It works!