Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Hardware SPI

 
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
shredder

Bascom Member



Joined: 28 Jun 2004
Posts: 3
Location: Auckland New Zealand

newzealand.gif
PostPosted: Mon Jun 28, 2004 11:56 am    Post subject: Hardware SPI Reply with quote

Hi
Im using ver 1.11.73 and a 8535 chip.
Have been interfacing to the WTS701 text to speech chip the code works
fine for software spi but if I change to spi = hard, nothing. Have got it
selected in the compile options.

Thanks Mike
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5319
Location: Holland

blank.gif
PostPosted: Wed Jun 30, 2004 10:23 pm    Post subject: Reply with quote

You need to use SPIINIT, and of course you need to select the right SPI mode.
_________________
Mark
Back to top
View user's profile Visit poster's website
shredder

Bascom Member



Joined: 28 Jun 2004
Posts: 3
Location: Auckland New Zealand

newzealand.gif
PostPosted: Fri Jul 02, 2004 4:23 am    Post subject: Reply with quote

Thanks Mark for the reply,
Have tried, but no luck yet. Below is a cutting of what I have done, the SPI soft works fine. Will look at it on a scope when I return to work in a week.


$regfile = "8535def.dat"
Config Spi = Soft , Din = Pinb.6 , Dout = Portb.5 , Ss = Portb.4 , Clock = Portb.7
'Config Spi = Hard , Interrupt = Off , Clockrate = 128 , Data Order = Msb , Master = Yes , Polarity = High , Phase = 1 , Noss = 1
Spiinit

Dim Spicmd(2) As Byte
Dim Spistring As String * 50


Ttspowerup:
Spicmd(1) = &H14 'select clock
Spicmd(2) = &H00 '00 = 24mhz
Spiout Spicmd(1) , 2
Waitms 100
Spicmd(1) = &H02 'powerup
Spicmd(2) = &H00
Spiout Spicmd(1) , 2
Waitms 100
'setvol 07 default = -28db 00 = 0db
Spicmd(1) = &H51
Spicmd(2) = &H00
Spiout Spicmd(1) , 2
Waitms 100
'conversion speed default h52 02 0-4 0 = slowest
Spicmd(1) = &H52
Spicmd(2) = &H00
Spiout Spicmd(1) , 2
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5319
Location: Holland

blank.gif
PostPosted: Fri Jul 02, 2004 8:40 pm    Post subject: Reply with quote

When you use NOSS option, you must make a CS/SS pin low/hight yourself.
_________________
Mark
Back to top
View user's profile Visit poster's website
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