Search found 8 matches
- Sat Feb 22, 2020 5:43 pm
- Forum: MicroPython pyboard
- Topic: data write speeds and broken SD cards
- Replies: 36
- Views: 36247
Re: data write speeds and broken SD cards
There is no "driver". The code I published does all the interfacing. I used a matlab script to display the results: fileID = fopen('test.bin'); A = fread(fileID); fclose(fileID) A=reshape(A,7,[]); x=A(2,:)+256*A(3,:); y=A(4,:)+256*A(5,:); z=A(6,:)+256*A(7,:); for i=1:length(x) if x(i)>32767 x(i)=x(i...
- Wed Apr 10, 2019 6:24 pm
- Forum: MicroPython pyboard
- Topic: data write speeds and broken SD cards
- Replies: 36
- Views: 36247
Re: data write speeds and broken SD cards
Now this was four years ago... I really don't remember much about that project! I dug out this code: # main.py -- put your code here! #INT1: Y4 #INT2: Y3 #/CS: Y5 #SDO: Y8 #SDA: Y7 #SCL: Y6 import os import pyb from pyb import SPI CMD_ID = bytearray((0x80,0)) #read device ID #write BW_RATE, max spee...
- Tue Aug 18, 2015 9:00 am
- Forum: MicroPython pyboard
- Topic: How to safely close SD card/file before power off?
- Replies: 4
- Views: 5119
Re: How to safely close SD card/file before power off?
Hm - I am aware of the USB mode switching (via boot.py) and use it in the final data logger application (as suggested in the wiki SDDatalogger article). I was just thinking that sync issues occur only between attached PC and pyboard file system, not on the pyboard itself. OK, so I'll try how everyth...
- Tue Aug 18, 2015 8:15 am
- Forum: MicroPython pyboard
- Topic: How to safely close SD card/file before power off?
- Replies: 4
- Views: 5119
Re: How to safely close SD card/file before power off?
It isn't. I used the following code (simplified): ls=os.listdir() print(ls) f=open('/sd/log1.bin','wb') f.write("asdf") f.close() and it did not seem to create the file if I ran it (inside a main.py) and pressed CTRL+D afterwards. Of course the connected PC does not see the file because it does not ...
- Tue Aug 18, 2015 7:54 am
- Forum: MicroPython pyboard
- Topic: How to safely close SD card/file before power off?
- Replies: 4
- Views: 5119
How to safely close SD card/file before power off?
I am working on a datalogger and am wondering what I have to do after a f.close to make sure that data is written to the SD card correctly. I tried a small example (file open, f.write a few characters, f.close) and noticed that the file is not created when I press CTRL+D after this code ran. Also, a...
- Tue May 26, 2015 6:53 pm
- Forum: MicroPython pyboard
- Topic: data write speeds and broken SD cards
- Replies: 36
- Views: 36247
Re: data write speeds and broken SD cards
Just finished the SMT rework to mount the ADXL375. Nasty work, even with professional equipment. But it works, at the first try! I did not even have to change the code, as both ADXLs are nearly identical interface-wise.
- Mon May 25, 2015 2:29 pm
- Forum: MicroPython pyboard
- Topic: data write speeds and broken SD cards
- Replies: 36
- Views: 36247
Re: data write speeds and broken SD cards
Actually it turned out to be much simpler than I thought. Instead of using interrupts and DMA, I just enabled the ADXL345 FiFo and configured the INT1 output for "watermark" mode with 20 entries (fifo is 32 entries). I set the ADXL345 for 3200 Hz sampling and monitor the INT1 line. If it is 1, I rea...
- Tue May 05, 2015 5:36 pm
- Forum: MicroPython pyboard
- Topic: data write speeds and broken SD cards
- Replies: 36
- Views: 36247
Re: data write speeds and broken SD cards
@Turbinenreiter: I pretty much want to do the same thing, high speed logging of accelerometer data onto the SD card. Would you share your code? Would help me quite a bit - I'm new to pyboard! BTW I want to measure the effectiveness of my bike suspension fork. I intend to place the accelerometer at t...