I have a Vdrive2 module and a 28X1. I can communicate with it fine using Technical's sample code over the UART interface (jumper select on the Vdrive2 to 3.3V). In fact, if I disconnect all the communications, and tie the CTS pin low, the device still initializes properly--the LED goes green on the Vdrive and the LED on the flash disk comes on.
However, if I switch the jumper to SPI communications, I cannot get the drive to initialize. I've attempted to apply the clock signal, pulling the chip select either high or low, and pulling Vdrive Pin7 high or low and combinations of the above but I get the same response from the Vdrive: alternating red/green for three cycles, same as at the beginning of the serial communications, then...nothing, as opposed to green lights when its in serial mode.
I'd like to use the SPI interface since the device that I'm datalogging from is occupying the hardware serial.
Note that for the moment, my question is somewhat PICAXE-independent. However, my first attempts at using the device with the PICAXE over SPI, before I knew how the initialization looked went as follows:<code><pre><font size=2 face='Courier'>symbol usbcs = 4
symbol tmp1 = b2
'USB module comms
hspisetup spimode11e,spifast '1 MHz clock well within 12 MHz limit, spislow/medium same result
sertxd("CP1",10,13) 'This shows up
high usbcs
sertxd("CP2",10,13) 'This shows up
hspiout (13)
sertxd("CP3",10,13) 'This doesn't show up
hspiin (tmp1)
sertxd("CP4",10,13) 'Neither does this
low usbcs </font></pre></code> Possibly more interesting is that after about two seconds, the PICAXE resets, sending both CP1 and CP2 messages again, and it repeats this process until I've unplugged it.
For this test, pinouts on the Vdrive are:
Vdrive Pin 1 (GND) -> GND,
Vdrive Pin 2 (SDO) -> PICAXE Pin 15 (SDI),
Vdrive Pin 3 (5V0) -> +5V,
Vdrive Pin 4 (SDI) -> PICAXE Pin 16 (SDO),
Vdrive Pin 5 (SCK) -> PICAXE Pin 14 (SCK),
Vdrive Pin 6 (CS) -> PICAXE Pin 25 (Out4/usbcs).
It's not a simple matter of having SDO and SDI swapped, since that's how I started off (oops) and it didn't work any better.
--Patrick
However, if I switch the jumper to SPI communications, I cannot get the drive to initialize. I've attempted to apply the clock signal, pulling the chip select either high or low, and pulling Vdrive Pin7 high or low and combinations of the above but I get the same response from the Vdrive: alternating red/green for three cycles, same as at the beginning of the serial communications, then...nothing, as opposed to green lights when its in serial mode.
I'd like to use the SPI interface since the device that I'm datalogging from is occupying the hardware serial.
Note that for the moment, my question is somewhat PICAXE-independent. However, my first attempts at using the device with the PICAXE over SPI, before I knew how the initialization looked went as follows:<code><pre><font size=2 face='Courier'>symbol usbcs = 4
symbol tmp1 = b2
'USB module comms
hspisetup spimode11e,spifast '1 MHz clock well within 12 MHz limit, spislow/medium same result
sertxd("CP1",10,13) 'This shows up
high usbcs
sertxd("CP2",10,13) 'This shows up
hspiout (13)
sertxd("CP3",10,13) 'This doesn't show up
hspiin (tmp1)
sertxd("CP4",10,13) 'Neither does this
low usbcs </font></pre></code> Possibly more interesting is that after about two seconds, the PICAXE resets, sending both CP1 and CP2 messages again, and it repeats this process until I've unplugged it.
For this test, pinouts on the Vdrive are:
Vdrive Pin 1 (GND) -> GND,
Vdrive Pin 2 (SDO) -> PICAXE Pin 15 (SDI),
Vdrive Pin 3 (5V0) -> +5V,
Vdrive Pin 4 (SDI) -> PICAXE Pin 16 (SDO),
Vdrive Pin 5 (SCK) -> PICAXE Pin 14 (SCK),
Vdrive Pin 6 (CS) -> PICAXE Pin 25 (Out4/usbcs).
It's not a simple matter of having SDO and SDI swapped, since that's how I started off (oops) and it didn't work any better.
--Patrick