Hi - I was on holiday last week, hence the lack of replies.
While it's unlikely to be your problem, you'd want to remove integer= from your code, as that's not doing what you expect :)
SPI.setup might be resetting pin states to their default values which would throw things off - you could try a slightly hacky method of just updating the software SPI values directly:
var spi = new SPI();
spi.setup({sck:B6, miso:A6, mosi:A7, mode:integer=0, order:'msb'});
digitalWrite(SS, 0);
spi.write(0b01000100);
spi._options.mode=3;
d = spi.write(0b01000100);
digitalWrite(SS, 1);
Otherwise I'd say to just manually create the waveform using for loops and digitalWrite. Some kind of oscilloscope would probably really help you do see what's going on though.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - I was on holiday last week, hence the lack of replies.
While it's unlikely to be your problem, you'd want to remove
integer=
from your code, as that's not doing what you expect :)SPI.setup
might be resetting pin states to their default values which would throw things off - you could try a slightly hacky method of just updating the software SPI values directly:Otherwise I'd say to just manually create the waveform using
for
loops anddigitalWrite
. Some kind of oscilloscope would probably really help you do see what's going on though.