Jump to content
43oh

[help] setup pwm frequency for Tiva C in Energia


Recommended Posts

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! 

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

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...