Richard Baguley on Adobe Scientist Cuts A Dash With LCD Shifting Dress.Then, once the stop is detected, I pull the received data off of the buffer, package it into a “packet” (basically just add the byte count as the first byte of the packet), then add each packet to a large circular buffer so I can pull the data off vis USBĢ023 Hackaday Supercon: The Rest Of The Talks 2 Comments Then, it just sits passively on the bus (NOT sending an ACK, or ever transmitting data), reading every byte is sees on the bus until a STOP is detected, and adding each byte to a buffer. Instead, my ISR sends an ACK for EVERY device address received (I have to send an ACK instead of just being passive on the bus because of they way the I2C hardware on this device works, if I do not ACK the first byte received the hardware will ignore all further bytes received and not fire I2C interrupts until the next START). Normally what would happen now is the ISR would compare the received device address to the one you programmed the MCU to respond to, and send an ACK if they match. What I did was set the I2C hardware to slave mode, so an interrupt fires when it detects activity on the bus. On that MCU, it has specialized I2C hardware, so you only have to peek/poke certain registers to make the I2C bus do what you want. I wrote some I2C sniffer code for a silabs C8051F340 MCU one time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |