Morning all
I have been using the PIC18F47K40 and have had the SD card working without a problem. On changing to the PIC18F47K42 the SD card does not pass the initialise component macro.
The code is identical between the two devices mentioned as are the pins, the clock frequency, the initial pre-scaler and the high speed pre-scaler.
The clock at the time of the card initialisation is 8 meg and the pre-scaler is f/64 which gives 125kHz to the card.
I have checked that all other pins used have been correctly allocated and have seen this problem on more than one PIC18F47K42
Any ideas?
Thanks Howard
FC9
SD card not initialising using 18F47K42 FC9
-
- Posts: 11
- http://meble-kuchenne.info.pl
- Joined: Mon Oct 24, 2022 12:27 pm
- Location: Cape Town
- Has thanked: 1 time
-
- Matrix Staff
- Posts: 1914
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 621 times
- Been thanked: 644 times
Re: SD card not initialising using 18F47K42 FC9
Hello.
Are you referring to a compiler error with just initialise, if so can you post your .fcfx, .c and .msg.txt files please.
Or are you referring to stuck on initialise within your hardware?
Are you referring to a compiler error with just initialise, if so can you post your .fcfx, .c and .msg.txt files please.
Or are you referring to stuck on initialise within your hardware?
Martin
Re: SD card not initialising using 18F47K42 FC9
Hello Martin
The hardware hangs at the point of initialisation.
I have done a sanity check by going back to the PIC18F47K40 and this does initialise and record in the main loop, using the same SD card.
The hardware hangs at the point of initialisation.
I have done a sanity check by going back to the PIC18F47K40 and this does initialise and record in the main loop, using the same SD card.
-
- Matrix Staff
- Posts: 1914
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 621 times
- Been thanked: 644 times
Re: SD card not initialising using 18F47K42 FC9
In that case can you try software mode instead.
The issue with 18FxxK42 devices is some of the SFR are different to the norm, so they are not currently supported with SPI or I2C.
The rules have been completely rewritten!
Sorry for any inconvenience.
The issue with 18FxxK42 devices is some of the SFR are different to the norm, so they are not currently supported with SPI or I2C.
The rules have been completely rewritten!
Sorry for any inconvenience.
Martin
Re: SD card not initialising using 18F47K42 FC9
Thanks I will give that a go and let you know if it works.
Re: SD card not initialising using 18F47K42 FC9
Again thanks, this has worked. Some points to note are that on this chip when using the software I2C the slew rate control must be on and when using the software SPI the slew rate control must be off.