Well, I'm not sure what the issue is you're seeing.
I just created a 12000 byte file and read it using SD.ReadByte() in a loop until EOF, and it worked for me.
This with SD_OPTIMIZE = true, 18F27K40, clock=64, MSSP1, SPI clk = spiOscDiv4 (16MHz), and an SD card formatted as FAT32
SD Card, PPS and the 18f26K40
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1488
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
-
- Posts: 38
- Joined: Wed Nov 02, 2022 10:31 am
Re: SD Card, PPS and the 18f26K40
G'day Guys
My apologies for not getting back to this sooner, ive been extremely busy over the xmas break with other projects.
Jerry i have tracked down my issue with the SD card reading and it was (as i pretty much suspected) my fault. My program includes a timer Interrupt and inside the Int routine was a call to another sub routine. The sub routine was very simple and i did not think to include the required context saving.. It wasn't until i read the help file on interrupts that it became clear how important it is..
I now have that sorted out 100%..
I do have some other questions regarding Interrupts, but i'll start a new thread for that..
Many thanks and Happy New year!
Lee
My apologies for not getting back to this sooner, ive been extremely busy over the xmas break with other projects.
Jerry i have tracked down my issue with the SD card reading and it was (as i pretty much suspected) my fault. My program includes a timer Interrupt and inside the Int routine was a call to another sub routine. The sub routine was very simple and i did not think to include the required context saving.. It wasn't until i read the help file on interrupts that it became clear how important it is..
I now have that sorted out 100%..
I do have some other questions regarding Interrupts, but i'll start a new thread for that..
Many thanks and Happy New year!
Lee
-
- Swordfish Developer
- Posts: 1488
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: SD Card, PPS and the 18f26K40
just to follow up... SDFileSystem (SDFS) 4.1.9 is included in the latest SF UPDATE 3_1_2023, so no need to download the 418 zip file
See using SDFileSystem with PPS (18FxxQ71 example) for details.
See using SDFileSystem with PPS (18FxxQ71 example) for details.