Re: [bascom] AVR SPIOUT


From "Ron Diol" <rsdiol@mich.com>
Date Thu, 21 Jun 2001 22:53:21 -0400

Hello,
I'm new to Bascom-AVR and am trying to get familiar with it. I'm using the
Atmel STK300 with an AT103L mcu and am attempting to communicate via SPI to
a Multimediacard. I'm unsure as to the difference between the spiout/spiin
and the shiftout/shiftin statements. I decided to to use the spi statements
and setup it up as:

Dim Res(15) As Byte
Dim Dat As Byte
Cs Alias Porte.2

Config Spi = Soft , Din = Porte.0 , Dout = Porte.1 , Ss = Porte.2 , Clock =
Porte.3
Spiinit
Set Cs
Waitms 100
'I now need to send 10 bytes of &HFF
Dat = &Hff
Spiout Dat, 10    ' Will this send out the desired 10 bytes of &HFF??


I need one more clarification, if you would please, in the following
example:

Dim a(10) as byte
SPIOUT a(1) , 4  'Send 4 bytes
SPIIN a(1) , 4  'Read 4 bytes

Does this automatically advance the array index as each byte is sent or
read? For example a(1), a(2), a(3) and a(4)

Any help would be highly appreciated.

Thank you in advance,

Ranjit











----- Original Message -----
From: "John W. Cannon" <johncannon@falconui.com>
To: <bascom@grote.net>
Sent: Tuesday, June 19, 2001 10:01 PM
Subject: [bascom] AVR Shiftin


> Hi List,
>
> Does the DELAY const in the SHIFTIN instruction specify the period of the
> bitstream after which the instruction will time out (even if data is still
> coming in)?
>
> Tnx in advance.
>
> John Cannon
>