SD Card, PPS and the 18f26K40

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SD Card, PPS and the 18f26K40

Post by Jerry Messina » Tue Dec 20, 2022 4:13 pm

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

Gunplumber
Posts: 38
Joined: Wed Nov 02, 2022 10:31 am

Re: SD Card, PPS and the 18f26K40

Post by Gunplumber » Sun Jan 01, 2023 11:28 am

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%.. :D

I do have some other questions regarding Interrupts, but i'll start a new thread for that..

Many thanks and Happy New year!

Lee

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SD Card, PPS and the 18f26K40

Post by Jerry Messina » Sat Mar 04, 2023 2:22 pm

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.

Post Reply