SPI1INIT, SPI1IN, SPI1OUT, SPI1MOVE

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Admin (Diskussion | Beiträge)
(Created page with "Some of the new MEGA processors like ATMEGA328<span style="font-weight: bold;">PB</span> have a second SPI bus. This is not a USART that can work in SPI mode but a full SPI bu...")
Zum nächsten Versionsunterschied →

Version vom 17. Januar 2017, 20:11 Uhr

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  
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Sprache