Other Parts Discussed in Thread: EK-TM4C1294XL
Dear Support,
With the TM4C1290NCPDT I am having a problem getting RTCCLK signal out the RTCCLK (PC5) pin. For "problem" read I am unsuccessful. I am using Code Composer Studio version 6.2.0.00050 with the TivaWare C Series 2.1.1.71 library.
Below is the code I use in an attempt to configure the PC5 to work as RTCCLK:
(Not shown is the code to enable/configure the Hibernate peripheral and get the RTC running. And I have added code to confirm the RTC seconds register is incrementing every second.)
// enable GPIOC
// (we have some pins to set up/configure)
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
// now wait for it to enable...
while ( false == SysCtlPeripheralReady ( SYSCTL_PERIPH_GPIOC ) ) ;
// RTCCLK is an alternate function
GPIOPinConfigure(GPIO_PC5_RTCCLK) ;
// just like DIVSCLK do this 2nd
GPIOPadConfigSet(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD ) ;
// we have to do the following for both RTCCLK and DIVCLK
// because the Tiva library does not offer
// a function to complete the set up to have the pin configured for use by the hardware/peripheral
// now configure the pin to be HW controlled!
// note this function writes the GPIO_O_AFSEL
// register with the Pin # to complete the transition to the alternate function!
GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_DIR_MODE_HW) ;
Let me add here that with the arguments appropriate to configure PQ4 to operate as DIVSCLK to emit the PIOSC clock the above same steps work just fine. I am getting the 16MHz PIOSC (albeit divided by 64 which is what I select via another register) out the DIVSCLK pin.
RTCCLK is only configured to emit the RTC clock signal during initial manufacturing test. The RTCCLK pin is just routed to a test pad almost directly under the pin so there's not much that can be wrong with it but I have confirmed it is not shorted to any other pin. Oh, I have noticed this behavior on two different hardware revisions of boards.
It is pretty important this work as we want to confirm the 32.768KHz clock is very accurate -- to within a few PPM. We use the RTC for critical timing of a MESH radio network. We also use the RTC to perform a calibration of the PIOSC to get the PIOSC to better than 1% accuracy.
Sincerely,
Marc Warden
Senior Firmware Engineer
Davis Instruments