it's an SS pin for SPI, Y5 or X5 depending on busdhylands wrote:Which pin are you using for CS?
PyBoard SPI strange behavior
Re: PyBoard strange behavior on SPI.write(bytes)
Re: PyBoard SPI strange behavior
I have also tried to use another pin like Y4 - same problem on Ctrl+D in REPL
Re: PyBoard SPI strange behavior
ok. now it is official. When SD card is being inserted and code (that initializes SPI and sends some init data to device) launched from it in REPL and then Ctrl+D is being pressed - BOOM, SD card error occurs.
Guys, do you have SD card and any SPI device (SSD1306 is preferable, but let's try anything for now) to test this case?
I have created a bug report
Guys, do you have SD card and any SPI device (SSD1306 is preferable, but let's try anything for now) to test this case?
I have created a bug report
Re: PyBoard SPI strange behavior
running test code from PYBFLASH is ok, except of its capacity... I can store only 10 frame files. Original animation is much longer and smoother. There is a more valuable problem with SD - I can't even open() and read() files while running from SD card. No CTRL+D pressing is needed. When SPI display is being initialized - there is a problem. And "import os" just hangs REPL then. So that SD card problem now is not marginal anymore.
Test animation is here
Test animation is here
Re: PyBoard SPI strange behavior
So here I am again.
To reproduce both ways:
1) get "display" and "frames" directories, and "animation.py" file from https://github.com/kamikaze/pyboard-examples
2) store "frames" directory on flash and SD card
3) store "display" directory and "animation.py" on flash (actually it doesn't matter where you will run the code from)
4) Run in REPL and get the output:
(First test is being killed manually by hitting Ctrl+C)
The only difference is where the code tries to get files from after SPI device is being initialized. And SD card is dead already. Unfortunately I don't have any other SPI device to prove that fault. So any help would be great. The only thing is needed:
1) initialize SPI and device
2) send some commands and/or data to SPI device
3) try to open() and read() any file from /sd/path
To reproduce both ways:
1) get "display" and "frames" directories, and "animation.py" file from https://github.com/kamikaze/pyboard-examples
2) store "frames" directory on flash and SD card
3) store "display" directory and "animation.py" on flash (actually it doesn't matter where you will run the code from)
4) Run in REPL and get the output:
Code: Select all
>>> import animation
>>> animation.run_test_from_flash()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/flash/animation.py", line 24, in run_test_from_flash
File "/flash/animation.py", line 21, in run_test
File "/flash/animation.py", line 16, in run_animation
File "/flash/display/ssd1322.py", line 95, in send_buffer
File "/flash/display/common.py", line 38, in write
KeyboardInterrupt:
>>> animation.run_test_from_sd()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/flash/animation.py", line 28, in run_test_from_sd
File "/flash/animation.py", line 21, in run_test
File "/flash/animation.py", line 13, in run_animation
File "/flash/animation.py", line 7, in read_frames
OSError: [Errno 5] EIO
The only difference is where the code tries to get files from after SPI device is being initialized. And SD card is dead already. Unfortunately I don't have any other SPI device to prove that fault. So any help would be great. The only thing is needed:
1) initialize SPI and device
2) send some commands and/or data to SPI device
3) try to open() and read() any file from /sd/path
Re: PyBoard SPI strange behavior
I've found the reason (but still not a solution):
https://github.com/kamikaze/pyboard-exa ... 322.py#L64
This line turns off a sleep mode of the screen. Datasheet says that in sleep mode display consumes 10 uA. So I suppose when sleep mode turns off (display starts to show stuff only then) - more current is being consumed and something goes wrong with SD. Is it possible?
https://github.com/kamikaze/pyboard-exa ... 322.py#L64
This line turns off a sleep mode of the screen. Datasheet says that in sleep mode display consumes 10 uA. So I suppose when sleep mode turns off (display starts to show stuff only then) - more current is being consumed and something goes wrong with SD. Is it possible?