Hi,
Hope someone can help, and sorry for the long post. I have reasonable experience of electronics hardware, but much less programming experience.
The task I've set myself as a learning exercise/project is to attempt to emulate a data logger device that represents itself as a USB HID. I've used USB monitoring software to gain an understanding of the messages the logger is sending. Apart from the enumeration phase when the device is first plugged in, it does not interact with the host thereafter, and just constantly transmits data to the host. It transmits 8 byte message blocks every 8ms. The blocks consist of parts of a message containing two A/D readings made every 32ms. The message when reconstructed is always in the format:
<<<<<jjkk llmm>>>>>>
then terminated with 0x0A and 0x0D. jjkk and llmm are the two A/D readings seperated by a space.
Each 8 byte data block consists of a first byte that indicates how many of the subsequent bytes are valid, followed by ASCII representation of the data. An example of actual transmitted data is:
05 3C 3C 3C 3C 3C 3E 0A = first 0x05 bytes only = <<<<< in ASCII
07 31 32 35 32 20 30 38 = 1252 08 (Note space, 0x20, between 1st and 2nd data pairs)
03 34 31 3E 32 20 30 38 = 41>
07 3E 3E 3E 3E 3E 0A 0D = >>>>> then 0x0A 0x0D
So the message reads:
<<<<<1252 0841>>>>>> terminated by 0x0A 0x0D.
The A/D measurements need to be fixed in time relative to the previous measurements (every 32ms) in order that varying input signals can be accurately reconstructed, so I'm assuming they are interrupt driven. Each 8 byte message block happens every 8ms, so I'm assuming they are interrupt driven. I'd be grateful if someone can explain to me (in general terms) how the I should go about emulating this message structure. Does the form of the messages indicate some standard technique?
I plan to develop this using C on an Atmel chip.
Thanks,
Mike