This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1230H6PM: Getting WT5CCP1 running

Part Number: TM4C1230H6PM

Hi all,

I'm attempting to get CCP1 working on WTIMER5 (pin PD7 on this product). Currently the counter sits at zero, it should be counting a 0 - 3.3V 10MHz crystal with the system clock running at 50MHz. I'm running TivaWare 2.1.4.178 and CCS 7.2.0.

Looking at the registers, the unlock procedure for PD7 is working and both timer A and B are enabled, I believe this is correct even though it's just timer B I want? If I'm running just timer B, do I still get a 32 bit timer and 16 bit prescaler? I've attached register values at the point I'm trying to read WTIMER5 TIMER_B value.

I've also tested using this setup with  TIMER_CFG_B_PERIODIC_UP instead of TIMER_CFG_B_CAP_COUNT_UP and the periodic timer mode works fine. 

    // *****************
    // Crystal counter
    // *****************
    // UNLOCK PD7
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
    for(i=0; i < 50; i++);

    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0x4C4F434B;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= GPIO_PIN_7;
    for(i=0; i < 50; i++);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER5);
    TimerDisable(WTIMER5_BASE, TIMER_BOTH);

	GPIOPinConfigure(GPIO_PD7_WT5CCP1);
    GPIOPinTypeTimer(GPIO_PORTD_BASE, GPIO_PIN_7);

    TimerConfigure(WTIMER5_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_CAP_COUNT_UP);
    TimerControlEvent(WTIMER5_BASE, TIMER_B, TIMER_EVENT_POS_EDGE);

    TimerPrescaleSet(WTIMER5_BASE, TIMER_B, 0xFFFF);
    TimerLoadSet(WTIMER5_BASE, TIMER_B, 0xFFFFFFFF);

    TimerPrescaleMatchSet(WTIMER5_BASE, TIMER_B,0x0);
    TimerMatchSet(WTIMER5_BASE, TIMER_B, 0x0);

    TimerEnable(WTIMER5_BASE, TIMER_BOTH);