Skip to content

WISP Firmware: Introduction

Qifan Lu edited this page Oct 6, 2017 · 4 revisions

WISP Firmware: Introduction

This article introduces part of the WISP firmware that relates to the WISP Extended Runtime.

Run Once Project

The WISP Extended Runtime contains a Run Once project, which is originally from the WISP5 firmware repository. The program in this project generates and stores random numbers for further WISP RFID communications. You should run this project once before moving on to the WISP ERT demo. When you see the LED light shining it means the initialization work is done.

MSP430 Interrupts

Like most of the other architectures, MSP430 supports hardware interrupts. An interrupt routine is defined with #pragma vector=[Interrupt Vector] and keyword __interrupt. Since the CPU will reset if an interrupt is unhandled, every WISP5 project should include a fallback interrupt handler to catch all unhandled interrupts. If you want to handle an interrupt in this case, don't forget to comment out corresponding #pragma directive or you will get redefinition errors.

RFID Features

The WISP5 firmware provides a group of functions to do RFID communication. The simple acknowledgement demo from the offical repository serves as a good example of the functions.

First of all, you should call WISP_init() to initialize the functionality of WISP firmware.

The WISP_registerCallback_*() group of functions can be used to set the hooks for RFID Read, Write, BlockWrite and Acknowledgement operations. These hook functions will be called after the RFID operation completes. Function WISP_setMode() and WISP_setAbortConditions() can be used to set up operating parameters for WISP RFID communication routines.

To get access to the WISP RFID data buffers, first prepare a piece of buffer for BlockWrite, sets the value of RWData.bwrBufPtr to the buffer you just created. Then, create an instance of WISP_dataStructInterface_t and pass the pointer of the instance to WISP_getDataBuffers(), and now you can get access to the Read, Write, BlockWrite and EPC buffer. Note that because of the way Impinj reader does BlockWrite, it isn't possible to get the size of the BlockWrite through blockWriteSizePtr. You have to prepend the length of the data to work around this problem.

Before we go into the RFID loop, we need to set up the EPC-96 field. In the original WISP5 demo, the last three bytes contain the WISP RFID class and the WISP ID. In the WISP Extended Runtime, the WISP RFID class and the WISP ID is instead placed in the first two bytes. All other ten bytes are used by WTP to send data to the server.