1. Write some software for the mbed that switches the RTC clock source from the external crystal to a (subdivided) internal clock, and then verify that you're programming the RTC, and it is advancing as you'd expect. Then load that app into your own LPC1768 design, and verify that you are seeing the same thing. this will prove the RTC is behaving as you would expect on your own design without the RTC crystal being a potential issue.
Good idea, but how to program something like this with the mbed compiler ? i imagine i need to modify the "clock source" register for the RTC, but i don't know how to do this... does mbed have a complete documentation somewhere with function to access of the internal LPC register ?
2. Write a test program that uses the external crystal, and verify that it is running on your mbed. Have a look at the signals on an oscilloscope, and get familar with what they should look like.
Point "2" -> all was perfect on my mbed ! my datalogger program and/or my RTC test program work fine.
I was try to see a signal on the 32.768 khz mbed crystal with my scope, but it is possible ? datasheet of LPC1768 indicate that the RTC system use a very low consumption power system, to see the RTC clock, the way seem to be use PINSEL3_P1_27_CLKOUT, but again, how to activate this pin with mbed compiler ? i'm very new with LPC and mbed... sorry.
3. Load the second test program into your LPC design, and compare on the scope what you see.
The last thing is to check the schematics of how you have it wired up, and the PCB layout. Screen captures from the board file would work fine, or print the schematic page (and board view) to a PDF and post it here.
Also, feel free to publish the test programs you are writing, so that other can verify correct behaviour.
Ok, i will do that asap.
I remember once someone telling me that crystals can be a bit fragile. It was an anecdote about a consignment of crystals that hand been handled roughly in distribution, and there were a lot of failing parts. Try fitting a crystal form a different batch/source, just in case.
I was try yesterday 4 new crystal from my local vendor... no change.
Hope that helps...
Yes ! thank you for your very useful help, I feel less alone with this issue.
thank you again.
Chris (the frog).
Cheers,
Chris
Hi !
I received my own design board based on the LPC1768 and Mbed eagle drawing.
After solder compoments, one by one with long verification process, my own board is alive ! FlashMagic give me the Device serial number and my first "hello wold" program is working. Great !
I try all parts of my hardware with basic program to test input/output, SdCard, serial (thru Ftdi232) all was perfect and finally i write a little program to test the RTC, my program set the RTC and give me the unix time in a do loop.
I could set the RTC clock, but my RTC don't run :-( very bad news for a datalogger !
I try to change the capacitor around my resonator (18pf -> 22pf) -> nothing
I change my resonator -> nothing
And i read again and again the PC1768 datasheet, perhaps i made issues.
I only find 32.768 Khz resonator (i already use it on I2C realtime chip), the datasheet speack only of 32khz ? a first issue ?
On the datasheet i could not understand if the Vbat need to be set to float if no external 3v battery is use or if Vbat pin (19) NEED to be connected to 3.3v ?
The datasheet say :
The VBAT pin supplies power only to the RTC domain. The RTC requires a minimum of
power to operate, which can be supplied by an external battery. The device core power
(VDD(REG)(3V3)) is used to operate the RTC whenever VDD(REG)(3V3) is present. Therefore,
there is no power drain from the RTC battery when VDD(REG)(3V3) is available.
Picture of the RTC circuit from the datasheet :
We could see Vbat and VDD go into the RTC Power Selector, but VDD seem to be internally wire ? i need to connect Vdd to Vbat pin or not ?
If need to connect VDD and 3v from battery to VBAT, i imagine i need to use diodes ?
If you have information about wiring the vbat pin of an LPC1768, your help will be greatly appreciated !
Thank you.
Regards,
Chris.