Other Parts Discussed in Thread: CC1310, SYSBIOS
Hello,
I have read several posts to the PinMuxing and also followed the API Reference examples, but i'm not able to measure anything on the output pin (DIO12) as mapped of my LAUNCHPAD with my oszilloscope.
Could you have a short look at my code to review and point me to some mistake?
In the CC1310_LAUNCHXL.c and .h header files I didn't changed anything.
#include <stdint.h>
/* XDC module Headers */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
/* RTOS header files */
#include <ti/sysbios/BIOS.h>
/* Example/Board Header files */
#include <ti/drivers/Board.h>
#include <ti/drivers/PIN.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/drivers/timer/GPTimerCC26XX.h>
#include <ti/drivers/pin/PINCC26XX.h>
#include <xdc/runtime/Types.h>
#include "Board.h"
#include <ti/devices/cc13x0/driverlib/osc.h>
Power_setDependency(XOSC_HF);
PIN_Handle PinHandle;
PIN_State ledPinState;
GPTimerCC26XX_Handle hTimer;
PIN_Config PinTable[] = {
Board_DIO12 | PIN_INPUT_DIS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
PIN_TERMINATE
};
/*
* ======== main ========
*/
int main(void)
{
int32_t PinMuxRes = 0;
/* Construct BIOS objects */
/* Call driver init functions */
Board_init();
if (OSCClockSourceGet(OSC_SRC_CLK_HF)!= OSC_RCOSC_HF){
OSCClockSourceSet(OSC_SRC_CLK_HF,OSC_RCOSC_HF);
}
PinHandle = PIN_open(&ledPinState, PinTable);
if(!PinHandle) {
/* Error initializing board LED pins */
while(1);
}
GPTimerCC26XX_Params timer_params;
GPTimerCC26XX_Params_init(&timer_params);
timer_params.width = GPT_CONFIG_32BIT;
timer_params.mode = GPT_MODE_PWM;
timer_params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
hTimer = GPTimerCC26XX_open(Board_GPTIMER0A, &timer_params);
if(hTimer == NULL) {
while(1);
}
Types_FreqHz freq;
BIOS_getCpuFreq(&freq);
//GPTimerCC26XX_Value loadVal = freq.lo / 1000 - 1; //47999
GPTimerCC26XX_Value loadVal = 0x00FFF;
GPTimerCC26XX_setLoadValue(hTimer, loadVal);
GPTimerCC26XX_setMatchValue(hTimer, 0x00000);
GPTimerCC26XX_PinMux pinMux = GPTimerCC26XX_getPinMux(hTimer);
PinMuxRes = PINCC26XX_setMux(PinHandle, Board_DIO12,pinMux);
GPTimerCC26XX_start(hTimer);
BIOS_start(); /* Does not return */
return(0);
}