Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

SPI reading from different address

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 68
Location: Ljubljana

slovenia.gif
PostPosted: Tue Jul 16, 2019 7:24 am    Post subject: SPI reading from different address Reply with quote

Hi,

I have this simple example of writing (to &H34) & reading (from &H74) from SPI addresses:

Code:
    Spi_array(1) = &H34
    Spi_array(2) = 0
    Reset Cs
       Spiout Spi_array(1) , 2
    Set Cs

    Spi_array(1) = &H74                                    
    Spi_array(2) = 0
    Reset Cs
      Spiin Spi_array_rx_status(1) , 2
    Set Cs


It happens that SPIOUT remembers the address where data was sent (Spi_array(1) = &H34) and with SPIIN command it reads data from this address and not from the address that I need to read (Spi_array(1) = &H74).

How to do that?

Best regards
Jure

(BASCOM-AVR version : 2.0.8.1 )
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Tue Jul 16, 2019 9:26 am    Post subject: Reply with quote

best to use spimove
_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum