-
Notifications
You must be signed in to change notification settings - Fork 12
HydraFW HydraNFC v2 guide dnfc SPI
Benjamin Vernoux edited this page Sep 12, 2020
·
3 revisions
Connections: four pins (MOSI/MISO/CLOCK/CS) and ground(GND).
Output type: 3.3volt normal, or open drain
(pull up/pull down resistors integrated in MCU or external).
Pull-up resistors: required for open drain output mode (2K – 10K).
Pull-up/down resistors Integrated in MCU: Between 30 to 50K (Typical 40K).
Maximum voltage: 5.5volts (5volt safe).
Output type - open drain/open collector (high=Hi-Z, low=ground),
normal (high=3.3volts, low=ground).
Use open drain/open collector output types with pull-up resistors
for multi-voltage interfacing.
This guide is updated towards firmware release HydraBus v1 HydraNFC Shield v2 firmware v0.2 Beta
-
show
Show SPI parameters orshow pins
Show pins used in this mode -
frequency
with floating frequency value (supportk
(for khz),m
(for mhz) suffix or no suffix)- Frequencies available for SPI2:
160khz
,320khz
,650khz
,1.31mhz
,2.62mhz
,5.25mhz
,10.5mhz
,21mhz
- Frequencies available for SPI2:
-
exit
to exit SPI mode
Hardware Informations:
dnfc2> show
Device: SPI2
GPIO resistor: floating
Mode: master
Frequency: 10.50mhz (160khz, 320khz, 650khz, 1.31mhz, 2.62mhz, 5.25mhz, 21mhz)
Polarity: 0
Phase: 1
Bit order: MSB first
dnfc2> show pins
CS: PC1 (SW)
SCK: PB10
MISO: PC2
MOSI: PC3
IRQ: PA1
trigger
configures the trigger mode
cs-on
or [
Chip select(CS) enable/active (low=state 0/GND).
cs-off
or ]
Chip select(CS) disable (high=state +3.3V).
dnfc2> [ 0xFF r ] [ 0 r ] [ 1 r ] [ 0x80 r ] [ 0x55 r 0xAA r 0xFF r 0x11:4 r:4 ]
/CS ENABLED
WRITE: 0xFF
READ: 0x00
/CS DISABLED
/CS ENABLED
WRITE: 0x00
READ: 0x00
/CS DISABLED
/CS ENABLED
WRITE: 0x01
READ: 0x00
/CS DISABLED
/CS ENABLED
WRITE: 0x80
READ: 0x00
/CS DISABLED
/CS ENABLED
WRITE: 0x55
READ: 0x00
WRITE: 0xAA
READ: 0x00
WRITE: 0xFF
READ: 0x00
WRITE: 0x11 0x11 0x11 0x11
READ: 0x00 0x00 0x00 0x00
/CS DISABLED
For more details on SPI protocol see: http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus