|
|
View previous topic :: View next topic |
Author |
Message |
rufinopc@rufinogg.com
Joined: 11 Mar 2023 Posts: 17
|
|
Posted: Thu Mar 16, 2023 5:22 am |
|
|
I appreciate the information on http://www.brushelectronics.com/software
I will consider purchasing, although for learning about SDs and PICs, it seems a bit excessive at the moment... |
|
|
rufinopc@rufinogg.com
Joined: 11 Mar 2023 Posts: 17
|
|
Posted: Sat Apr 01, 2023 5:00 am |
|
|
Sorry for forgetting.
I had forgotten to give an answer to this problem that had been left open for 15 days.
First of all I put one of the MPLABx examples up and running with XC16, it took some work because it was not prepared for dsPIC33 either, but in the end it is very stable, but, as you know, it is quite complex due to the versatility of micros, FAT, etc for those who make it.
Once I got it working I couldn't resist leaving the example, posted by more people on this CCS forum, without getting it to work for 16-bit as well.
The solution was quite simple, but at the same time delicate. First of all, you have to remember that the PIC24 and dsPIC33 are 16-bit micros, so you have to be very scrupulous with the variables:
By default all types are 8-bit unsigned, while for the PCD compiler they are 16-bit signed, except float chat which are signed. This causes a severe conflict if you have not been very scrupulous when preparing the program, since it is not worth just adding
#include <stdint.h>
You also have to provide a substitution with
#type INT=8
#type unsigned
But this is not enough either since the "char" although they are 8 bits, the PCD interprets them as signed int8. If you don't want to maintain compatibilities, the best thing to do is replace the "char" with "unsigned char", the "int8", "int16" and "in32" with uint8_t...etc. as long as they are not specifically signed.
After all this you can already read and write to the SD. It is also true that it is not very stable, but with a little patience you can achieve a definitive job, and if you want it compatible with 8 bits. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Sat Apr 01, 2023 9:58 am |
|
|
Well done.
This has been discussed here in the past, with migration to the DSPIC's,
with several people (myself included), pointing out these issues. It is a
different 'mindset' from the smaller PIC's. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|