SPI1INIT, SPI1IN, SPI1OUT, SPI1MOVE

From MCS Wiki AVR
Revision as of 22:11, 17 January 2017 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Some of the new MEGA processors like ATMEGA328PB have a second SPI bus. This is not a USART that can work in SPI mode but a full SPI bus.

 

In order to use the second SPI which is named SPI1, you have to add a '1' to the SPI commands :

 

CONFIG SPI1

SPI1INIT

SPI1IN

SPI1OUT

SPI1MOVE

 

The statements above link to the description of the SPI statements (SPI0).

 

 
'in this demo we only use the second SPI interface
ConfigSpi1 =Hard ,Interrupt =Off,Data_order =Msb ,Master =Yes ,Polarity =Low,Phase =0 ,Clockrate =128
 
'second SPI
Spi1init
B =5
Spi1outA(1),B
Spi1inA(1),B
A(1)=Spi1move(a(2))


Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language