Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

using SPI on mega8..couldn't comprehend

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
Phani

Bascom Member



Joined: 31 May 2005
Posts: 1
Location: Monroe

PostPosted: Tue May 31, 2005 7:55 pm    Post subject: using SPI on mega8..couldn't comprehend Reply with quote

I am trying to use SPI of mega8 (as master and SPI of sensor as slave)..but my sensor needs a byte as input and returns 16 bit value as output. It takes 100 ms after recieving an input to send output..

I couldn't comprehend the SPI functions to realize this situation..

Anyone did encounter the same problem??

any suggestions??

Regards,

Phani.
Back to top
View user's profile
Frankeman

Bascom Member



Joined: 11 Aug 2004
Posts: 948
Location: the Netherlands

netherlands.gif
PostPosted: Wed Jun 01, 2005 9:22 am    Post subject: Reply with quote

Hi,

It is not so difficult to do the SPI yourself.
Toggle a pin (clock) 8 times while on an other pin (data) you put bit the 8 bits.
Wait 100 ms
Toggle the clock pin another 16 times while reading back the bits received.

Frank.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive 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