altineller 4 Posted March 2, 2016 Share Posted March 2, 2016 Hello, I am using the latest energia release 0101E0017 and suddenly analogWrite and PWMWrite does not work on my TivaC Board, with TM4C123 #define EN_A PF_0 #define EN_B PF_1 #define IN1 PE_0 #define IN2 PE_1 #define IN3 PE_3 #define IN4 PE_2 #include <wiring_analog.c> void setup() { pinMode(EN_A, OUTPUT); pinMode(EN_B, OUTPUT); pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); } void loop() { PWMWrite(EN_B, 256, 16, 1000); } I tried few different ports as well. When the PWMWrite or analogWrite statement is run, the pin will just go high. I have tested with a scope that PWM signal is not generated. Now the interesting thing - I fired the following code on the same setup, this time using Servo.h - connected to RED_LED and It works. #include <Servo.h> Servo myservo; void setup() { myservo.attach(PF_1); } void loop() { myservo.write(5); } What do I need to do in order to get PWM working with this TivaC board? Best regards, C. Quote Link to post Share on other sites
Fmilburn 445 Posted March 2, 2016 Share Posted March 2, 2016 @@altineller See this thread: http://forum.43oh.com/topic/7330-pwm-changes-depending-on-the-code-its-running/ altineller 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.