Overtone Labs

I am exploring stickOS on a cui32 and attempting to connect an spi ram as a first exercise. The first bit of test code I am using is:

  10 dim sdo as pin rg8 for digital output

  20 dim sck as pin rg6 for digital output

  21 rem get nothing if this dim is missing but no reference in the Guide

  30 dim sdi as pin rg7 for digital input

  40 dim comd as byte

  50 let comd = 15

  60 dim cs as pin rg9 for digital output

  70 while 1 do

  80   let cs = 0

  90   qspi comd

 100   let cs = 1

 110   sleep 100 us

 120 endwhile

I can see the clock and the chip enable but no activity on the sdo line. I have searched the available information sources but can find no guidance and the documentation seems uninformative about the initialisation of spo for this board implying that the first qspi call will set the pins and all the registers. I can’t think this is the case. Is there an initialisation instruction in stickos basic  for the sio on pic32 or am I missing something?

 

Thanks in advance for any help,

Mike

Views: 102

Reply to This

Replies to This Discussion

Hi Mike,

By default, pin re1 is the cs pin for SPI on pic32 StickOS ... see here:

http://www.cpustick.com/downloads/microchip.pdf

as it mentions, this can be reassigned persistently with the “pins” command - but if you didn't do this, the problem might be as simple as that.

Dan

Thanks, Dan. I put it down to trying to do three jobs at the same time!

Dan Overholt said:

Hi Mike,

By default, pin re1 is the cs pin for SPI on pic32 StickOS ... see here:

http://www.cpustick.com/downloads/microchip.pdf

as it mentions, this can be reassigned persistently with the “pins” command - but if you didn't do this, the problem might be as simple as that.

Dan

Reply to Discussion

RSS

© 2013   Created by Dan Overholt.

Badges  |  Report an Issue  |  Terms of Service