Skip to content

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.


Example:

const uint8_t CS_PIN = 8;
MicrochipSRAM sram(CS_PIN);

Overview

Overview
Installation
Class Instantiation

Public Functions

get()
put()
clearMemory()
fillMemory()

Public Variables

SRAMBytes

Example Program

sram_read_write_test

Clone this wiki locally