Fixed the bug. Attached is the client program running on windows this time.
I've uploaded the sources, the ready-to-run java ".jar" file and the binary drivers for windows, linux and mac to a subdirectory in svn for other people to use.
Jar file here:
/trunk/javaclient/MotorClient.jar - Open ReVolt - Trac
Drivers:
/trunk/javaclient/MotorClient/lib - Open ReVolt - Trac
... and the relevant code from the avr:
Code:
Buffer_StoreElement(&txBuffer, (uint8_t) (tmpThrottle >>8)); // Store value for throttleH into ringbuff
Buffer_StoreElement(&txBuffer, (uint8_t) tmpThrottle); // Store value for throttleL into ringbuff
Buffer_StoreElement(&txBuffer, (uint8_t) (tmpCurrent >>8)); // Store value for currentH into ringbuff
Buffer_StoreElement(&txBuffer, (uint8_t) tmpCurrent); // Store value for currentL into ringbuff
Buffer_StoreElement(&txBuffer, (uint8_t) (pwmDuty >>8)); // Store value for currentH into ringbuff
Buffer_StoreElement(&txBuffer, (uint8_t) pwmDuty); // Store value for currentL into ringbuff
Buffer_StoreElement(&txBuffer, (uint8_t) 0xF0); // Sync Byte
Buffer_StoreElement(&txBuffer, (uint8_t) 0xFF); // Sync Byte
//enable USART "TX buffer empty" interrupt
UCSRB |= _BV(UDRIE);