Gen2 Write Command Implementation Notes

Details on using the Gen2 Write command with WISP.


1. Write

(This should be easier now that BlockWrite is figured out - see below)

2. BlockWrite Example Code - mbmoessner mbmoessner


For those who want to try it - just add a function call to the main switch case:

 
 
if ( bits >= NUM_WRITE_BITS && ( cmd[0] == 0xC7 ) )
{
handle_write(STATE);
...
 
// I want to write just 16 Bits so I have defined:
 
#define MAX_NUM_WRITE_BITS 70
#define NUM_WRITE_BITS 60
 
// and have adjusted the reset values from MAX_NUM_READ_BITS to MAX_NUM_WRITE_BITS. I just accomplished writing to the tag (had to try the new debugger) so the values might be adjusted.
 
 
inline void handle_write(volatile short nextState)
{
TACCTL1 &= ~CCIE;
TAR = 0;
int z=0;
for(z=0;z<100;z++){
while ( TAR < 100 ){};
TAR=0;
}
readReply[0] = queryReply[0];
readReply[1] = queryReply[1];
crc16_ccitt_readReply(0);
 
TRext = 1;
sendToReader(&readReply[0], 34);
TRext = 0;
state = nextState;
delimiterNotFound = 1; // reset
}





The last modification was made by - mbmoessner mbmoessner on Mar 30, 2010 12:10 am