I need to program a PIC16F648 as a slave device using the address detect mode under interrupt. The idea is to flag the foreground program only when an address match has occurred with a small data packet attached that was read correctly. I would then ACK the host and set a global flag to tell the foreground that a packet has been received.
eg:- if I am address $85 then
$185 (address $85 , thats me so I read on)
$10 (eg:- packet length 16 bytes)
$CC (checksum)
$nn....$nn (16 bytes of data)
if all went well, I then send an ACK to the host
and flag the foreground routine that a packet is ready.
Can anyone point me to a code example to save me some time? Thanks in advance, Dave
Bookmarks