Skip to content

RFID Moisture Updates

mattguo5 edited this page Nov 26, 2019 · 26 revisions

RFID Moisture Updates

post newest updates at the top and have dividing lines between them:


Nov 12, 2019 - Feather M0 Port of Sparkfun RFID code

Author: Matt Guo

  • Successful port of Sparkfun RFID constant read to Feather M0
Show More

Description

A successful port of the Sparkfun RFID constant read Arduino code to the Feather M0 has been made. To make this port successful, SN74AHCT125N logic level shifters were needed. These logic level shifters were used over the sparkfun breakout for their faster slew rates, required for high baud rate for the UART transmission. The SN74AHCT125N is a one-way logic level shifter - it can only go from 3.3V to 5V, or vice versa. The output logic level is dictated by the Vcc voltage. Two of these shifters were used for the design, one to transition from 3.3V to 5V, and the other going from 5V to 3.3V.

The original Sparkfun RFID constant read code for the Arduino Uno utilizes the softSerial library for Tx and Rx pins on GPIO 2 and 3. When porting over to the Feather M0, this softSerial library is not available, thus alternatives were needed. Adapted from Adafruit's website on 'Adapting Uno Sketches to the M0', PIO_SERCOM's pinPeripheral was initialized on the code to the Feather M0's pins 10 and 11 for Tx and Rx. This allows the creation of a new serial, arbitrarily called as rfidSerial, to be used whenever UART communication is needed in the sketch.

Error's occurred whenever the rfidSerial was closed and reinitialized to actively change the baud rate, which was initially handled in the setupNano() function from the Constant Read code. This was avoided by initializing the rfidSerial to a set baud rate of 115200 and leaving the communication handling to 115200.

Relevant files and links to other material References if any were used to figure something out
Clone this wiki locally