Tool/software: TI C/C++ Compiler
hola! buen dia a todos!, Tengo unas dudas acerca de como configurar el timer empleando las bibliotecas de TIVAWARE. Ya revise los ejemplos que proporcionan el fabricante, ahora quiero saber como puedo hacer que este retardo lo pueda configurar de manera ascendente de hecho este es mi codigo:
#include <stdint.h>
#include <stdbool.h>
#include "inc/tm4c1294ncpdt.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "inc/hw_memmap.h"
#include "driverlib/timer.h"
#include "driverlib/interrupt.h"
//Variables globales
bool state;
void Timer0IntHandler(void)
{
TimerIntClear(TIMER0_BASE,TIMER_TIMA_MATCH);
if(state==true)
{
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0|GPIO_PIN_1,0x03);
state=false;
}
else
{
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_0|GPIO_PIN_1,0x00);
state=true;
}
}
void main(void)
{
//Habilita el modulo GPIO N
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
//Espera que el modulo GPIO N este listo
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPION));
//Configuramos el puerto N 0 y 1 como salidas
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE,GPIO_PIN_0|GPIO_PIN_1);
//Habilitamos el TIMER0
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
//Esperamos a que el modulo TIMER0 este listo
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_TIMER0));
//Configura el Timer para 16 bits en modo periodico
TimerConfigure(TIMER0_BASE,TIMER_CFG_A_PERIODIC_UP);
//Carga el valor de Timeout
TimerMatchSet(TIMER0_BASE,TIMER_A,65535);
//Activa la interrupcion time out
TimerIntEnable(TIMER0_BASE,TIMER_TIMA_MATCH);
TimerIntRegister(TIMER0_BASE,TIMER_A,Timer0IntHandler);
IntEnable(INT_TIMER0A);
IntMasterEnable();
TimerEnable(TIMER0_BASE,TIMER_A);
/*****************************************PROGRAMA PRINCIPAL*****************************************************/
while(true);
}
I assumed that something similar to the example only that using the match register, but it doesn't work for me and another doubt is how I can use the prescaler here because at register level I can do it, but using the TIVAWARE library I don't have the slightest idea.
The teacher explained to us more or less some peripherals not all, apart from the SPMU298a manual, is there any book or page where I can help me to understand the TIVAWARE library?
Thank you!! and excuse my questions