Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP8266 SPI doesn't work. #775

Closed
SpenceKonde opened this issue Jan 4, 2016 · 2 comments
Closed

ESP8266 SPI doesn't work. #775

SpenceKonde opened this issue Jan 4, 2016 · 2 comments

Comments

@SpenceKonde
Copy link

Using an AT25512 EEPROM on ESP8266: (using d8dec28 build from forum)


var fakespi=new SPI();
pinMode(13,"output");
fakespi.setup({sck:D4,miso:D5,mosi:D12});
var eeprom=require("AT25").connect(fakespi, 128, 512, D13);

returns:

eeprom.read(0,10);
=new Uint8Array(10)


pinMode(13,"output");
SPI1.setup({sck:D4,miso:D5,mosi:D12});
var eeprom=require("AT25").connect(SPI1, 128, 512, D13);
doesnt:
eeprom.read(0,10);
=new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])

Trying to write does not result in data being written to the EEPROM.

Should be returning (both return this from a pico), and I can write it from the pico too.
[115, 99, 114, 101, 119, 98, 97, 108, 108, 101]

On one occasion, I was able to make this work with software SPI, but I'm not sure what changed, and I cannot reproduce that finding.

When using software SPI (on ESP8266), trying to send an array of bytes resets the board:
fakespi.send([0,0,0,0,255,255,128,64,255,64,192,128,255,255])

@olliephillips
Copy link

Wild guess - I set pinMode with the alpha prefix you are just calling the number here. What happens if you add the letter prefix?

@SpenceKonde
Copy link
Author

No change in behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants