View Single Post
Old 06-17-2009, 02:01 PM   #17 (permalink)
charlie_fd
EcoModding Lurker
 
Join Date: May 2009
Location: Bucharest,RO and Copenhagen,DK
Posts: 42
Thanks: 0
Thanked 1 Time in 1 Post
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);
Attached Thumbnails
Click image for larger version

Name:	CougarClientWin32.jpg
Views:	19
Size:	21.3 KB
ID:	3712  
  Reply With Quote