Jump to content
43oh

Recommended Posts

Hello! This is my first time posting, so please let me know if I missed anything!

 

I am attempting to use the TivaWare library to modify the clock speed of my Tiva-C (EK-TM4C123GXL) microcontroller. Eventually I plan to use this to construct an alarm clock, with the timing based off of the accurate crystal on the Tiva-C.

 

When I attempt to compile the following code (largely based off of a library written by Yannick and Graham Fountain) I receive a long list of errors, also included below.

 

Code:


#include "driverlib/interrupt.h"

#include "driverlib/sysctl.h"

#include "driverlib/timer.h"

 

  //INITIALIZE GLOBAL VARIABLES

  int RTCsec = 0;

  int RTCmin = 0;

  int RTChr = 0;  

 

void setup()

{

  //INITIALIZE TIMER AND INTERRUPTS

  SysCtlClockFreqSet(SYSCTL_OSC_INT|SYSCTL_USE_PLL|SYSCTL_CFG_VCO_320, 40000000);//SET system clock to 40 MHz

  TimerIntRegister(TIMER0_BASE, TIMER_A, Timer0Isr);    // Register ISR       

  TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);  //Enable ISR

  Serial.begin(9600);

}

 

void loop()

{

      if (RTCsec >= 60) {

        RTCsec=0;

        RTCmin++;

    };

      if (RTCmin >= 60) {

        RTCmin=0;

        RTChr++;

    };

    if (RTChr >= 24) {

        RTChr=0;

    };

//WRITE TIME TO COMPUTER

    Serial.print("Hour:");

    Serial.print(RTChr);

    Serial.print("\t\t");

    Serial.print("Minute:");

    Serial.print(RTCmin);

    Serial.print("\t");

    Serial.print("Second:");

    Serial.print(RTCsec);

    Serial.print("\n");  

}

 

void Timer0Isr(void)

{

  TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);  // Clear the timer interrupt

  RTCsec++;

}//END CODE


 

Errors:

...(There is a long list of C:\... errors above this that I omitted for the sake of brevity)...

C:\Users\Mike\General\Computer Manuals, tools, and files\energia-0101E0012-windows\energia-0101E0012\hardware\lm4f\cores\lm4f/driverlib/timer.h:278:30: error: variable or field 'TimerDMAEventSet' declared void

C:\Users\Mike\General\Computer Manuals, tools, and files\energia-0101E0012-windows\energia-0101E0012\hardware\lm4f\cores\lm4f/driverlib/timer.h:278:30: error: 'uint32_t' was not declared in this scope

C:\Users\Mike\General\Computer Manuals, tools, and files\energia-0101E0012-windows\energia-0101E0012\hardware\lm4f\cores\lm4f/driverlib/timer.h:278:49: error: 'uint32_t' was not declared in this scope

InterruptTimerAttemptFail.ino: In function 'void setup()':

InterruptTimerAttemptFail.ino:13:80: error: 'SysCtlClockFreqSet' was not declared in this scope

InterruptTimerAttemptFail.ino:14:51: error: 'TimerIntRegister' was not declared in this scope

InterruptTimerAttemptFail.ino:15:49: error: 'TimerIntEnable' was not declared in this scope

InterruptTimerAttemptFail.ino: In function 'void Timer0Isr()':

InterruptTimerAttemptFail.ino:46:48: error: 'TimerIntClear' was not declared in this scope

 

END ERRORS

 

I checked in my energia install folder, and all of the commands I used are listed in the .h file of the libraries I included. 

 

All help is appreciated, and thanks in advance!

Link to post
Share on other sites
Hello! This is my first time posting, so please let me know if I missed anything!

 

I am attempting to use the TivaWare library to modify the clock speed of my Tiva-C (EK-TM4C123GXL) microcontroller. Eventually I plan to use this to construct an alarm clock, with the timing based off of the accurate crystal on the Tiva-C.

 

When I attempt to compile the following code (largely based off of a library written by Yannick and Graham Fountain) I receive a long list of errors, also included below.

 

Code:


#include "driverlib/interrupt.h"

#include "driverlib/sysctl.h"

#include "driverlib/timer.h"

 

  //INITIALIZE GLOBAL VARIABLES

  int RTCsec = 0;

  int RTCmin = 0;

  int RTChr = 0;  

 

void setup()

{

  //INITIALIZE TIMER AND INTERRUPTS

  SysCtlClockFreqSet(SYSCTL_OSC_INT|SYSCTL_USE_PLL|SYSCTL_CFG_VCO_320, 40000000);//SET system clock to 40 MHz

  TimerIntRegister(TIMER0_BASE, TIMER_A, Timer0Isr);    // Register ISR       

  TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);  //Enable ISR

  Serial.begin(9600);

}

 

void loop()

{

      if (RTCsec >= 60) {

        RTCsec=0;

        RTCmin++;

    };

      if (RTCmin >= 60) {

        RTCmin=0;

        RTChr++;

    };

    if (RTChr >= 24) {

        RTChr=0;

    };

//WRITE TIME TO COMPUTER

    Serial.print("Hour:");

    Serial.print(RTChr);

    Serial.print("\t\t");

    Serial.print("Minute:");

    Serial.print(RTCmin);

    Serial.print("\t");

    Serial.print("Second:");

    Serial.print(RTCsec);

    Serial.print("\n");  

}

 

void Timer0Isr(void)

{

  TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);  // Clear the timer interrupt

  RTCsec++;

}//END CODE


 

Errors:

...(There is a long list of C:\... errors above this that I omitted for the sake of brevity)...

C:\Users\Mike\General\Computer Manuals, tools, and files\energia-0101E0012-windows\energia-0101E0012\hardware\lm4f\cores\lm4f/driverlib/timer.h:278:30: error: variable or field 'TimerDMAEventSet' declared void

C:\Users\Mike\General\Computer Manuals, tools, and files\energia-0101E0012-windows\energia-0101E0012\hardware\lm4f\cores\lm4f/driverlib/timer.h:278:30: error: 'uint32_t' was not declared in this scope

C:\Users\Mike\General\Computer Manuals, tools, and files\energia-0101E0012-windows\energia-0101E0012\hardware\lm4f\cores\lm4f/driverlib/timer.h:278:49: error: 'uint32_t' was not declared in this scope

InterruptTimerAttemptFail.ino: In function 'void setup()':

InterruptTimerAttemptFail.ino:13:80: error: 'SysCtlClockFreqSet' was not declared in this scope

InterruptTimerAttemptFail.ino:14:51: error: 'TimerIntRegister' was not declared in this scope

InterruptTimerAttemptFail.ino:15:49: error: 'TimerIntEnable' was not declared in this scope

InterruptTimerAttemptFail.ino: In function 'void Timer0Isr()':

InterruptTimerAttemptFail.ino:46:48: error: 'TimerIntClear' was not declared in this scope

 

END ERRORS

 

I checked in my energia install folder, and all of the commands I used are listed in the .h file of the libraries I included. I assume that I am missing something obvious about implementing the TivaWare libraries that I just missed online, but I haven't been able to find it.

 

All help is appreciated, and thanks in advance!

Link to post
Share on other sites

Thanks everyone for your quick and helpful advice!

 

L.R.A.'s suggestion of replacing the ".h" with ".c" on my include commands fixed the errors! Also, adding

#include "Energia.h"

and leaving the included libraries as ".h" (As suggested by igor on http://forum.stellarisiti.com/topic/2009-tivaware-errors/)%C2'> fixed the problem.

 

Thanks again for all of your help!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...