Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC32 PINGUIONO's and SD
05-05-2012, 10:58 AM, (This post was last modified: 05-05-2012, 11:00 AM by mf01.)
#23
RE: PIC32 PINGUIONO's and SD
Hi Dale,

1. The problem with r378 I let you know about has been resolved by r381 - a very good and fast response by YeisonEng.

2. Although I have not researched this further yet, whilst the changes to X.2 r305 to get the SD functions working with the PIC32 Pinguino OTG board are relatively few and manageable (as the OTG board was supported in X.2 prior to r305) support for the PIC32 Pinguino Micro was not introduced till after r305 and most of the changes to support the Micro board have not been incorporated into the Trunk/X.2. I am not saying that it is not possible to modify X.2 r305 to support the Micro board, just that it will need a lot of research to identify all the necessary file changes. At the time the SD library was developed the Pinguino IDE did not support the PIC32 Pinguino Micro, (which I think did not become available till later) and so it based around the OTG board and did not take the Micro into account and this is probably the fundamental reason for some of the problems you have been having with trying to get it working on the Micro.

3. The SD library makes use of the RTCC library for the time and date when writing a file to a card. There is a note in the appropriate file (diskio.c) that says that it assumes that the RTCC has been set and running. What I had forgotten was that the inclusion of the setting of the RTCC at the start of the DataLogger.pde example was to cover the assumption in the diskio.c file as well as providing the data to be written. Therefore any program that writes data to an SD card using the current version of the SD library needs to first set the RTCC and this has two implications which I will cover separately below.

4. I recently found a problem with another program that resulted in the setting data for the real time clock getting corrupted. I did not manage to fully determine the cause but did find that if the setting data was put in setup( ) rather than where it is the DataLogger.pde example then the problem did not occur. This means that the setup ( ) becomes :-

Code:
void setup() {
    const    u32     Tm           = 0x10170000; // Time for clock setting             format = 0xHHMMSS00
    const    u32     Dt           = 0x12011703; // Date and day for clock setting     format = 0xYYMMDD0W
                                                //    W = day of week,    Saturday = 0 Friday = 6
                                                // see array Day[][] above
    const    u16     drift        = 180;        // add 180 pulses every minute to adjust time

    /*    Set Real Time Clock and Calendar */
    RTCC.open(Tm, Dt, drift);                    // Sets date, time and calibration & starts RTC
}

and the definitions of Tm, Dt and drift are removed from the start of the program.

5. The dependency of the current SD writing functions on the RTCC has implications for the PIC32 Pinguino Micro. As far as I can see, the Micro board does not have a 32,768 kHz crystal for the RTCC (compare the schematic for the Micro with that for OTG particularly to the left of the processor). When the RTCC is set, one of the things that is checked is that the secondary oscillator is running - I believe that the secondary oscillator is the one using the 32,768 kHz crystal. I think that the implication of this is that if you try to set the RTCC on the Micro board then it will never pass the test for the secondary oscillator being running and therefore never exit that part of the program. To use the SD library with the Micro this dependency needs to be dealt with (see below).

6. I think therefore you have two choices - the first one, and the simplest from the programming point of view is to use the PIC32 Pinguino OTG board. The changes needed to get this running from x.2 r305 are relatively straight forward and as it does have full RTCC support will enable you to date and time stamp any files written to the SD card. The second, and more complex, is to get an IDE environment that supports the Micro board and then modify the diskio.c file so that for the PIC32 Pinguino Micro it no longer makes use of the RTCC. You will need to think how you create a suitable date and time stamp for when files are written to the card. It may be that using a "fixed data and time" is sufficient for your purposes.

7. If the reason you are using the Micro board is the number of input and output lines you need you may want to look at "CON3" on the OTG board. The OTG board as supplied does not have a connector fitted but does have the pads for that connector. On one of my OTG boards I fitted a suitable connector - it was a bit fiddly as the pads at on 0.05" (1.27mm) centres and one of the capacitors and the power connector are rather close but it is doable with a steady hand and possibly a magnifying glass. There are 8/10 digital I/O available on CON3 (RE0-7, RD1 which is connected to the yellow LED and RF1 = IDE P22 - P31).

Hope this helps.

Regards
Board = PIC32-Pinguino-OTG Rev C
OS = Linux Unbuntu 11.10 till 26 Apr 2012
OS = Linux Unbuntu 12:04 from 27 Apr 2012
Reply


Messages In This Thread
PIC32 PINGUIONO's and SD - by KiloOne - 19-03-2012, 02:32 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 21-03-2012, 10:47 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 22-03-2012, 08:17 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 22-03-2012, 08:27 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 23-03-2012, 10:36 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 02-05-2012, 02:34 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 02-05-2012, 04:08 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 02-05-2012, 07:53 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 02-05-2012, 09:33 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 03-05-2012, 12:17 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 03-05-2012, 04:35 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 04-05-2012, 03:20 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 04-05-2012, 09:53 AM
RE: PIC32 PINGUIONO's and SD - by pingotg - 04-05-2012, 03:35 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 04-05-2012, 09:44 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 04-05-2012, 11:25 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 12:23 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 12:46 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 01:14 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 01:27 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 10:58 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 01:19 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 01:51 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 02:36 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 04:51 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 05:58 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 07:22 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 08:04 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 09:18 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 09:22 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 10:37 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 11:01 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 11:05 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 05-05-2012, 11:50 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 05-05-2012, 11:57 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 10:42 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 10:47 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 11:30 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 02:01 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 03:30 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 03:36 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 03:43 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 03:53 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 05:41 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 07:04 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 06-05-2012, 07:18 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 07:41 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 07:57 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 09:42 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 06-05-2012, 08:21 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 08:39 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 06-05-2012, 08:47 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 09:12 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 09:20 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 06-05-2012, 09:23 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 09:27 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 06-05-2012, 09:30 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 09:39 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 06-05-2012, 09:47 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 10:19 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 06-05-2012, 11:04 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 06-05-2012, 11:53 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 07-05-2012, 12:09 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 07-05-2012, 12:25 AM
RE: PIC32 PINGUIONO's and SD - by pingotg - 07-05-2012, 12:33 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 07-05-2012, 12:34 AM
RE: PIC32 PINGUIONO's and SD - by mf01 - 07-05-2012, 09:09 AM
RE: PIC32 PINGUIONO's and SD - by pingotg - 07-05-2012, 09:43 AM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 07-05-2012, 01:24 PM
RE: PIC32 PINGUIONO's and SD - by pingotg - 07-05-2012, 02:01 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 07-05-2012, 02:38 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 07-05-2012, 03:28 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 07-05-2012, 04:05 PM
RE: PIC32 PINGUIONO's and SD - by KiloOne - 07-05-2012, 04:39 PM
RE: PIC32 PINGUIONO's and SD - by mf01 - 07-05-2012, 04:52 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)