More AVR

I've got the first pass of the Biooid bus sensor code almost done. I can hook the ATmega168 to the bus, send it a packet, and it parses the packet, recognizes what kind of command it is (PING, READ_DATA, WRITE_DATA), and does the appropriate thing, complete with writing response packets back. I'm reading data from all six channels of the IMU, and updating the control table values where they are kept. The only real issue right now is that the UART code I am using is assuming a standard two-wire UART, so the Tx pin isn't hooked to the bus. My brother Dave, who has helped me enormously getting all this going, and provided all the support code to access the various hardware features of the AVR, is going to adapt the work he did on the ATmega128 application so the UART on the ATmega168 will work the same way.

All of this work on the IMU module will apply almost 100% to the foot pressure module as well, so I'm really killing two birds with one stone here, in terms of the software. The code I'm writing (which I will release once it is done and fully working) will allow any kind of sensor to be hooked up to the Bioloid bus, assuming the ATmega168 can talk to it.
The control table for the IMU sensor will look like this:
EEPROM
0 Model Number (L)
1 Model Number (H)
2 Version of Firmware
3 ID
4 Baud Rate
5 Return Delay Time
6-15 Reserved
16 Status Return Level
17-23 Reserved
RAM
24 Reserved
25 LED
26 Forwards acceleration low
27 Forwards acceleration high
28 Sideways acceleration low
29 Sideways acceleration high
30 Vertical acceleration low
31 Vertical acceleration high
32 Pitch rate low
33 Pitch rate high
34 Roll rate low
35 Roll rate high
36 Yaw rate low
37 Yaw rate high
I may add another value, which allows you to specify one of a couple orientations that the sensor is mounted in. This will just affect which A/D port goes into which of the above control table registers.
*The BrainBot project is directed and funded by the Brain Engineering Lab and Neukom Institute
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home