Author |
Message |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Mon Dec 16, 2024 11:43 pm Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
I finally got all the methods working. There is all example code below for 50 Hz square complementary wave. You can adjust the dead time with 3 code examples.
These codes work with compiler version ... |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Mon Dec 16, 2024 7:02 am Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
Big question.
What compiler version?????
This is vital, since some compiler version do not correctly setup options
like the MFINTOSC source.
Two comments. Get rid of PROTECT, till you have t ... |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Sun Dec 15, 2024 10:39 pm Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
Welcome to the CCS forum! Generating PWM can be tricky, especially when you're setting up peripherals like timers and CCP modules. Here are a few suggestions that might help debug your issue:
Thing ... |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Sun Dec 15, 2024 10:35 pm Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
Key is one error in your setup.
You are telling the PWM, to clock of Fosc, so off 32MHz.
32000000/16/10001 =199.98Hz. just under 4* what you want.
More, the internal prescaler only supports /1, ... |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Sun Dec 15, 2024 5:32 am Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
Thank you for information. I will try it tomorrow and i will tell the results. |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Sun Dec 15, 2024 1:35 am Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
I tried increasing the PWM frequency, but that didn't work.
I also tried decreasing the frequency of the MCU, but that didn't work either. |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Sat Dec 14, 2024 7:47 am Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
It is for a full-bridge driver.
I already got it working with other methods but I am curious about this one because with this method I can use 32 MHz mcu clock and 50 Hz PWM at the same time as I ... |
Topic: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
halilemirhankara
Replies: 13
Views: 2454
|
Forum: General CCS C Discussion Posted: Fri Dec 13, 2024 2:17 am Subject: PIC16F1846 PWM GENERATION WITH SETUP_PWM1 |
Hi, this is my first post on the CCS forum. I tried to solve this problem on my own but reading datasheets or surfing the net didn't help me.
I am trying to generate PWM 50Hz through the PWM pe ... |
|