Skip to content

HydraFW 3wire guide

Baldanos edited this page Oct 17, 2016 · 14 revisions

#HydraFW Bus 3-wire

Bus: 3-wire
Connections: three pins (SDI/SDA/SCK) and ground
Output types: open drain/open collector
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)

This is a raw 3-wire communication mode (similar to SPI, but with full pin control)

This guide is updated towards firmware release HydraFW v0.8 Beta: HydraFW (HydraBus) v0.8-beta-0-ga2aab9d 2016-10-13

##Protocol configuration syntax description:

  • show Show 3-wire parameters or show pins Show pins used in this mode

  • pull with parameter up or down or floating to choose internal MCU pull up/down or no pull/external

  • frequency with floating frequency value (support k (for khz), m (for mhz) suffix or no suffix)

    • Frequencies available: up to 1MHz
  • msb-first or lsb-first to send/receive respectively MSB first or LSB first.

  • exit to exit 3-wire mode

Note default value: 
    > 3-wire
    Device: threewire1
    GPIO resistor: floating
    Frequency: 1000000Hz
    Bit order: MSB first

###Configuration options:

Hardware Informations:

threewire1> show pins 
CLK: PB3
SDI: PB4
SDO: PB5

###Protocol configuration example:

Configuration of threewire1 500KHz:

> 3-wire 
Device: threewire1
Frequency : 1000000Hz
threewire1> frequency 500k show 
Device: threewire1
Frequency : 500000Hz

##Protocol interaction syntax description:

r or read Read one byte. (r:1…255 for bulk reads)

hd Read one byte. (hd:1…255 for bulk reads). Displays a hexdump of the result (See Hexdump guide)

w or write Followed by values to write byte(s). (w:1…255 for bulk writes)

0 Write this Octal value. Format is prefixed by a 0 (values from 000 to 077)

0b Write this binary value. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.

0x Write this HEX value. Format is 0x01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.

0-255 Write this decimal value. Any number not preceded by 0x or 0b is interpreted as a decimal value.

" Write an ASCII-encoded string

Write support optional repeat : (eg.: 10:1…255 for repeated write of same value 10 in this example)

space Value delimiter. Use a space to separate numbers/commands. Any combination is fine, delimiter is required between each number/command, example: [ 0x1 0xff 0 10 0b11 077 ]

& Delay 1uS. (&:1…1000000 for multiple delays)

% Delay 1mS. (%:1…1000000 for multiple delays)

~ Write a random byte. (~:10 repeats the same random byte 10 times)

###Protocol interaction example usage threewire1 write/read:

threewire1> 0x01 0x02 ~ r 0x00:4
WRITE: 0x01 0x02 0xFF 
READ: 0xFF
WRITE: 0x00 0x00 0x00 0x00 

##Additional informations about 3-wire

For more information about its usage, see : http://dangerousprototypes.com/docs/Raw_3-wire

How to Flash/Use HydraFW

How to Build/Flash/Use HydraFW

Developer Getting-Started with HydraBus and STM32CubeIDE

Hardware

Firmware (hydrafw) performances

Firmware (hydrafw) Application guides

Firmware (hydrafw) guides

How to Help

Clone this wiki locally