Author |
Message |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Fri May 11, 2012 3:46 am Subject: Problems with PWM using PIC18F25k22 |
Hi mcr1981,
I had the same problem using pic18f13k22. The problem was that i had to setup CCP2 before setup timer 2 in the main code, CCP2 would not work without it, a bug with that pic.
You said ... |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Thu May 10, 2012 1:43 pm Subject: Problems with PWM using PIC18F25k22 |
HI MCR 1981,
I am no coding expert but i did pick up a few tips doing my project, i think to set up a PWM, you need to set up timer 2, it determines the PWM frequency,
using the formula
Period ... |
Topic: PWM/DAC...etc General advice required. |
kcj
Replies: 16
Views: 21550
|
Forum: General CCS C Discussion Posted: Tue Mar 06, 2012 10:34 am Subject: PWM/DAC...etc General advice required. |
Hi Mike & everybody,
Thanks for all your suggestions, I increased the sampling time of the xbee to its maximum 50ms and discovered an extra PIN was configured as a an analogue sample pin, so it ... |
Topic: PWM/DAC...etc General advice required. |
kcj
Replies: 16
Views: 21550
|
Forum: General CCS C Discussion Posted: Sat Feb 18, 2012 8:44 am Subject: PWM/DAC...etc General advice required. |
Hi Mike,
Okay. At 100RPM there is 6 samples per revolution, this will correspond to half a sin wave depending where the first sample was taken. ie from o to pie.
The ADC converter change this an ... |
Topic: PWM/DAC...etc General advice required. |
kcj
Replies: 16
Views: 21550
|
Forum: General CCS C Discussion Posted: Fri Feb 17, 2012 7:08 pm Subject: PWM/DAC...etc General advice required. |
Hi Mike,
Thanks for your input, i am still working on the problem and am trying some of your suggestions, which make interesting reading.
I had an idea of an alternative solution. Considering t ... |
Topic: PWM/DAC...etc General advice required. |
kcj
Replies: 16
Views: 21550
|
Forum: General CCS C Discussion Posted: Wed Feb 15, 2012 3:11 pm Subject: PWM/DAC...etc General advice required. |
Hi Mike, SherpaDoug,
Sorry for the late reply, Wednesday and Thursday are lecture and training full, so I haven't had a chance to reply until now.
Answers to original posts
1) Not entirely su ... |
Topic: PWM/DAC...etc General advice required. |
kcj
Replies: 16
Views: 21550
|
Forum: General CCS C Discussion Posted: Tue Feb 14, 2012 5:36 pm Subject: PWM/DAC...etc General advice required. |
Hi Mike,
Sorry yes it is alot of information, to clarify.
1) The only input into the PIC is from the coordinator xbee. Tx/Rx Pin. A router xbee is connected to a flexiforce sensor via an OPAMP. ... |
Topic: PWM/DAC...etc General advice required. |
kcj
Replies: 16
Views: 21550
|
Forum: General CCS C Discussion Posted: Tue Feb 14, 2012 4:17 pm Subject: PWM/DAC...etc General advice required. |
Hi All,
I have a general question regarding the best way to output a 10bit number on a PIC pin, the number is related to a force sensor voltage whose value changes every 10th of a second, voltage i ... |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Thu Feb 09, 2012 5:11 pm Subject: Problems with PWM using PIC18F25k22 |
Ah thats a shame, i use CCS PIC C compiler. I have not got MPLAB setup, but maybe i should as it is very interesting to know how to solve future problems.
Thanks for the help. |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Thu Feb 09, 2012 4:26 pm Subject: Problems with PWM using PIC18F25k22 |
Yes, that did work, Thanks for your help. I had a look at the .lst file. My first time looking at one. From what i have read, the .lst file is the assembly code the compiler uses to execute the progra ... |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Thu Feb 09, 2012 10:54 am Subject: Problems with PWM using PIC18F25k22 |
Hi,
I have being testing the other PWM, all work fine using the following code but if i set up CCP2 then all of the CCP stop working and pins are 0v.
#include <18F25k22.h>
#fuses HS,NOBR ... |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Thu Feb 09, 2012 8:19 am Subject: Problems with PWM using PIC18F25k22 |
Hi PCM,
yes that did solve the problem and CCP1 works fine but when i add CCP2, both CCP1 and CCP2 stop and have 0v at the pins
#include <18F25k22.h>
#fuses HS,NOBROWNOUT,NOWDT,PUT,STV ... |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Wed Feb 08, 2012 5:58 pm Subject: Problems with PWM using PIC18F25k22 |
Hi TteImah,
i could not find a built in function to disable the secondary oscillator but i have being learning to use the datasheet a bit more and it says to use the TXCON register setting bit TXS ... |
Topic: Problems with PWM using PIC18F25k22 |
kcj
Replies: 16
Views: 30973
|
Forum: General CCS C Discussion Posted: Wed Feb 08, 2012 10:12 am Subject: Problems with PWM using PIC18F25k22 |
Hi All,
Pic18F25k22 has 5 CCP available. After reading the datasheet and lots of posts on this website, i used the following code to set up CCP1 and CCP2.
#include <18f25k22.h>
#fuses HS ... |
Topic: DAConverter PIC18F13k22 problem |
kcj
Replies: 9
Views: 13330
|
Forum: General CCS C Discussion Posted: Mon Jan 30, 2012 9:22 am Subject: DAConverter PIC18F13k22 problem |
Hi All,
I have a general question regarding PWM and CCP. I am using PIC 18F13k22 which has one CCP1 but 4 PWM pins, namely P1A,P1B,P1C and P1D, can each of the pin be used as a PWM output.
The h ... |
|