Other Parts Discussed in Thread: EK-TM4C123GXL, SW-TM4C
I'm using EK-TM4C123GXL Launch pad.
I'm using Keil MDK v5 as my IDE.
I'm trying to access PWM on this board.
I wrote the code using the pwm API provided.
my code is given below
---------------------------------------------------------------------------------------------------------------------
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_pwm.h"
#include "inc/hw_sysctl.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/interrupt.h"
#include "driverlib/pwm.h"
#include "tm4c123gh6pm.h"
#define PWM1_BASE 0x40029000
int main()
{
unsigned long PERIOD;
PWMGenConfigure(PWM1_BASE, PWM_GEN_3,PWM_GEN_MODE_DOWN); // configure PWM1, generator 3, count down mode
PWMGenPeriodSet(PWM1_BASE, PWM_GEN_3,0x0000018F); // set pwm wave period
PERIOD = PWMGenPeriodGet(PWM1_BASE, PWM_GEN_3); // get the pwm wave period
PWMGenEnable(PWM1_BASE, PWM_GEN_3); // Enables the timer/counter for a PWM generator block 3.
PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7,0x00000063); //Sets the pulse width for the specified PWM output.
PWMOutputState(PWM1_BASE, PWM_OUT_7_BIT,true); //Enables PWM outputs.
PWMOutputInvert(PWM1_BASE, PWM_OUT_7_BIT,false); //Selects the inversion mode for PWM outputs.
PWMOutputFaultLevel(PWM1_BASE, PWM_OUT_7_BIT,false); //Specifies the level of PWM outputs suppressed in response to a fault
// condition.
PWMOutputFault(PWM1_BASE, PWM_OUT_7_BIT,false); //Specifies the state of PWM outputs in response to a fault condition.
while(1)
{
}
}
------------------------------------------------------------------------------------------------------------------------------
when compiled, the compiler gives error message as given below
---------------------------------------------------------------------------------------------------
compiling pwm_using_API.c...
pwm_using_API.c(42): warning: #1-D: last line of file ends without a newline
}
pwm_using_API.c(18): warning: #550-D: variable "PERIOD" was set but never used
unsigned long PERIOD;
pwm_using_API.c: 2 warnings, 0 errors
linking...
.\MPPT.axf: Error: L6218E: Undefined symbol PWMGenConfigure (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMGenEnable (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMGenPeriodGet (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMGenPeriodSet (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMOutputFault (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMOutputFaultLevel (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMOutputInvert (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMOutputState (referred from pwm_using_api.o).
.\MPPT.axf: Error: L6218E: Undefined symbol PWMPulseWidthSet (referred from pwm_using_api.o).
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 9 error messages.
".\MPPT.axf" - 9 Error(s), 2 Warning(s).
Target not created
---------------------------------------------------------------------------------------------------------------------
please tell me how to fix this error.