-
Notifications
You must be signed in to change notification settings - Fork 2
Class Instantiation
Arnd edited this page Dec 3, 2016
·
3 revisions
The class requires one parameter to instantiate, this is the CS/SS pin used by SPI to address the chip.
The SPI protocol requires 4 lines to be used:
- MISO (Master In Slave Out) - The Slave line for sending data to the master.
- MOSI (Master Out Slave In) - The Master line for sending data to the peripherals.
- SCK (Serial Clock) - The clock pulses which synchronize data transmission generated by the master.
- CS/SS (Chip Select or Slave Select)
The first 3 lines are common to all SPI devices that may be attached, and each SPI device requires a dedicated CS/SS pin.
This class assumes that the system uses the default Arduino hardware MISO, MOSI and SCK pins and it uses the Arduino SPI Library. The SPI settings can be changed after class instantiation should that be necessary.
const uint8_t CS_PIN = 8;
MicrochipSRAM sram(CS_PIN);