MAX3421 USB Peripheral and Host Controller with SPI Interface
Layout of a
board
Overview
This module interfaces to MAX3421 based USB Peripheral and Host Controller.
Wiring
| MAX3421 | Original Board | Pico Board |
|---|---|---|
| GND | GND | GND |
| 3.3V | 3.3V | 3.3V |
| MOSI | B5 (SPI1 MOSI) | A7 (SPI1 MOSI) |
| MISO | B4 (SPI1 MISO) | A6 (SPI1 MISO) |
| SCK | B3 (SPI1 SCK) | A5 (SPI1 SCK) |
| SS | A0 | B3 |
| RESET | A1 (3.3V) | B4 |
| IRQ | C3 | B1 |
| GPX | C2 | B5 |
Usage
Usage is very simple. Using the example pins shown above:
SPI1.setup({mosi: B5, miso: B4, sck: B3, baud: 1000000, order: 'msb'});
var max3421=require("MAX3421").connect(SPI1, A0, A1, C3, C2);
In order to read the revision of the MAX3421 device call something like:
console.log('Revision:', max3421.queryRevision());
It should read 1 (for version 1), 18 (for version 2) or 19 (for version 3). Eventually also a higher number. However, if it reads 255, please check your SPI connections and soldering contacts.
To use this board you have to initialize it first with:
console.log('Revision:', max3421.powerOn());
Since this board allows to work either as host or peripheral, low speed and high speed, no further code is added here. The amount of code needed to make every connection working is too much at this level. Though, you can use this as a base for further explorations.
Buying
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.