Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Equivalent of SPIMOVE on an Xmega?

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

Bascom Member



Joined: 23 Mar 2015
Posts: 16

blank.gif
PostPosted: Thu Aug 18, 2016 5:44 pm    Post subject: Equivalent of SPIMOVE on an Xmega? Reply with quote

Hello,

Some time ago (in the days when I used to use regular "megas", not "xmegas"), I ran into an SPI-based peripheral chip which made use of - and actually required - the full duplex aspect of SPI communication. In other words, the slave chip was sending back useful data on the MISO line as the master was sending out instructions on the MOSI line. At the time, BASCOM's SPIMOVE statement was great for that.

Granted, a lot of SPI peripherals don't seem to take advantage of that full-duplex capability. Many of them don't sent useful data on the MISO line until after they have been given their complete instructions on the MOSI line ... and then, when the subsequent SPI clock pulses are sent (to retrieve all of the good stuff on the MISO line), the slave chip just ignores the MOSI line (or in some cases, the datasheet specifies that the MOSI line must be kept in a particular state - thereby "sending" 0x00 or 0xFF for each do-nothing stimulating byte).

So, even though I transitioned from Megas to Xmegas quite a while ago (I love those powerful little MCUs! Very Happy), full duplex SPI is not something I have had to concern myself with - until now. In a current project, I have once again run into a slave chip which requires a full duplex arrangement.

Of course, I have been doing SPI in Xmegas for quite a while, but always with PRINT and INPUT statements - neither of which seem to be suitable for full duplex. Did I miss something in BASCOM's Help (which I did look at, as I always do)? Is there indeed an equivalent way (in BASCOM) of doing an SPIMOVE for Xmegas(?) ... or, do I need to roll my own routine?

Cheers!

Brant

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
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