View previous topic :: View next topic |
Author |
Message |
shredder
Joined: 28 Jun 2004 Posts: 3 Location: Auckland New Zealand
|
Posted: Mon Jun 28, 2004 11:56 am Post subject: Hardware SPI |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed Jun 30, 2004 10:23 pm Post subject: |
|
|
You need to use SPIINIT, and of course you need to select the right SPI mode. _________________ Mark |
|
Back to top |
|
|
shredder
Joined: 28 Jun 2004 Posts: 3 Location: Auckland New Zealand
|
Posted: Fri Jul 02, 2004 4:23 am Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Jul 02, 2004 8:40 pm Post subject: |
|
|
When you use NOSS option, you must make a CS/SS pin low/hight yourself. _________________ Mark |
|
Back to top |
|
|
|
|
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
|
|