# wispsensor

### Site Tools

gen2_write_implementation_notes

# Differences

This shows you the differences between two versions of the page.

 gen2_write_implementation_notes [2018/07/11 08:25] gen2_write_implementation_notes [2018/07/11 08:25] (current) Line 1: Line 1: + ====== 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 - [[http://​www.wikispaces.com/​user/​view/​mbmoessner|{{http://​www.wikispaces.com/​user/​pic/​mbmoessner-lg.jpg?​16x16|mbmoessner}}]] [[http://​www.wikispaces.com/​user/​view/​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 - [[http://​www.wikispaces.com/​user/​view/​yeagerd|{{http://​www.wikispaces.com/​user/​pic/​yeagerd-lg.jpg?​16x16|yeagerd}}]] [[http://​www.wikispaces.com/​user/​view/​yeagerd|yeagerd]] on Apr 26, 2012 9:28 am
gen2_write_implementation_notes.txt · Last modified: 2018/07/11 08:25 (external edit)