Sign in to follow this  
Followers 0
hvbon2010

[help] setup pwm frequency for Tiva C in Energia

2 posts in this topic

Hello everyone,

I'm trying setup pwm frequency for tiva C in Energia but failed at this line: analogFrequency(PWM_FREQ)

// define PWM pins
#define PWM_1 PD_6

// define PWM frequency
#define PWM_FREQ 20000

void setup()
{
  pinMode(PWM_1, OUTPUT);
  analogFrequency(PWM_FREQ);
}

void loop()
{
   analogWrite(PWM_1, 50);
}

 

Can help me with the problem, thank! 

Share this post


Link to post
Share on other sites

I recognized some problems:

1. How to use Tivaware for Energia to configure frequency PWM

2. How to fix pin_map.h problem

Resolve:

Problem 1: After install Energia  1.6.10E18 version, run Energia and select: board --> boards manager --> install Energia Tivac board

                  After installed Energia Tivac, Tivaware library is taken your system following link:

                  /home/bonho/.energia15/packages/energia/hardware/tivac/1.0.2/system/driverlib

Where bonho is my PC name, this link is hidden, to see this link in your PC, select view ---> show hidden file on the taskbar

                  Create new file in Enrgia, include Energia file as file is included below

                  I has one example to you compare between CCS programing and Energia programing included below 

Problem 2: preference this topic: I fixed the problem success

 

GPIO.h

include.h

pin_map_tm4c123gh6pm.h

PWM.ino

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0