Author |
Message |
Topic: Manual PWM set up works but #use pwm() does not; Why? |
mictel
Replies: 8
Views: 3064
|
Forum: General CCS C Discussion Posted: Thu Mar 20, 2025 6:22 am Subject: Manual PWM set up works but #use pwm() does not; Why? |
Ttelmah,
Received similar reply from CCS in response to my email alert. Very pleased they were able to review and correct so quickly.
Downloaded the latest version of PWM (5.119) and confirm the ... |
Topic: Manual PWM set up works but #use pwm() does not; Why? |
mictel
Replies: 8
Views: 3064
|
Forum: General CCS C Discussion Posted: Sat Mar 08, 2025 12:53 pm Subject: Manual PWM set up works but #use pwm() does not; Why? |
Revised code but still no pwm output on alternate pin A5.
Had to add one more control statement to get it to work: output_drive(PIN_A5); Learned this from previous post by PCM Programmer, thank you ... |
Topic: Manual PWM set up works but #use pwm() does not; Why? |
mictel
Replies: 8
Views: 3064
|
Forum: General CCS C Discussion Posted: Sat Mar 08, 2025 12:18 pm Subject: Manual PWM set up works but #use pwm() does not; Why? |
Ttelmah, a sincere thank you for your prompt review and for answering my questions. Rookie misunderstanding the PWM duty cycle calculation.
Regarding the #use pwm directive; it seems the directive i ... |
Topic: Manual PWM set up works but #use pwm() does not; Why? |
mictel
Replies: 8
Views: 3064
|
Forum: General CCS C Discussion Posted: Fri Mar 07, 2025 10:59 pm Subject: Manual PWM set up works but #use pwm() does not; Why? |
Working with PIC12LF1822 with PWM application and have a couple questions. First, Manual CCP1 set up generates PWM output on re-mapped pin (A5) but duty cycle is not as expected, not sure why. Dut ... |
Topic: RMS Value Calculation Using 12 bit ADC |
mictel
Replies: 19
Views: 34934
|
Forum: General CCS C Discussion Posted: Fri Sep 05, 2014 4:25 pm Subject: RMS Value Calculation Using 12 bit ADC |
Ditched the FP math thanks to the knowledge shared here. Now have the 12 bit ADC RMS measurement working with integer math. Did not do a comparison on speed but here is the results for accuracy:
... |
Topic: RMS Value Calculation Using 12 bit ADC |
mictel
Replies: 19
Views: 34934
|
Forum: General CCS C Discussion Posted: Tue Aug 26, 2014 6:31 am Subject: RMS Value Calculation Using 12 bit ADC |
You folks are great! I really appreciate the suggestions and encouragement to consider switching over to integer math. I presently lack the knowledge on how to do that so took the easy way out; FP. ... |
Topic: RMS Value Calculation Using 12 bit ADC |
mictel
Replies: 19
Views: 34934
|
Forum: General CCS C Discussion Posted: Mon Aug 25, 2014 5:58 am Subject: RMS Value Calculation Using 12 bit ADC |
Not sure why changing the format in a printf statement from %f to %E would change memory requirements to be out of ROM.
I did not measure how long it takes for the FP RMS calculation but can say th ... |
Topic: RMS Value Calculation Using 12 bit ADC |
mictel
Replies: 19
Views: 34934
|
Forum: General CCS C Discussion Posted: Mon Aug 25, 2014 4:46 am Subject: RMS Value Calculation Using 12 bit ADC |
Thank you for the explanation and suggestions. Interestingly, it all seems to be working fine even with the analog input voltage up to maximum, 5V.
The large value of the sum of the squares displa ... |
Topic: RMS Value Calculation Using 12 bit ADC |
mictel
Replies: 19
Views: 34934
|
Forum: General CCS C Discussion Posted: Sat Aug 23, 2014 8:02 pm Subject: RMS Value Calculation Using 12 bit ADC |
The complier version is PCM 5.026
Both versions of the format are shown. The %E format is rounded but not totally bogus. The problem is when I try to use the %e format in my main program, the com ... |
Topic: RMS Value Calculation Using 12 bit ADC |
mictel
Replies: 19
Views: 34934
|
Forum: General CCS C Discussion Posted: Sat Aug 23, 2014 4:45 pm Subject: RMS Value Calculation Using 12 bit ADC |
I changed code example ex_rmsdb.c from 8bit to 12bit ADC using the 16F1789. The algorithm squares the samples then sums them up so the sum gets very large very quick but thought I was OK since the li ... |
Topic: Internal Op-Amp Not Working [Solved] |
mictel
Replies: 1
Views: 3966
|
Forum: General CCS C Discussion Posted: Fri Jun 27, 2014 10:20 pm Subject: Problem Solved |
After some experimentation and quality time with the data sheet...
The format of Op-Amp setup is:
setup_opamp1(OPAMP_ENABLED|OPAMP_HIGH_GBWP_MODE);
Note that the option to connect the inverti ... |
Topic: Internal Op-Amp Not Working [Solved] |
mictel
Replies: 1
Views: 3966
|
Forum: General CCS C Discussion Posted: Fri Jun 27, 2014 8:26 pm Subject: Internal Op-Amp Not Working [Solved] |
I'm trying to use the internal Op-Amps in the 16F1789 for the first time. I configured them as follows:
setup_opamp1(OPAMP_ENABLED);
setup_opamp1(OPAMP_HIGH_GBWP_MODE);
... |
Topic: Op Amps and ADCs using the same pin |
mictel
Replies: 6
Views: 10468
|
Forum: General CCS C Discussion Posted: Sun Jun 15, 2014 9:11 pm Subject: Op Amps and ADCs using the same pin |
Well that is the way I had hoped it would work so you don't have to use up other ADC pins but was not sure. The 16F527 made things even more confusing with specific block diagrams showing one of the ... |
Topic: Op Amps and ADCs using the same pin |
mictel
Replies: 6
Views: 10468
|
Forum: General CCS C Discussion Posted: Sun Jun 15, 2014 9:06 am Subject: Op Amps and ADCs using the same pin |
The data sheet on the 16F1789 OPA Module does not show any lines going to the ADC Mux so then I assume you can not read the OP Amp output with the ADC channel assigned to the same I/O pin on the 16F17 ... |
Topic: Op Amps and ADCs using the same pin |
mictel
Replies: 6
Views: 10468
|
Forum: General CCS C Discussion Posted: Sun Jun 15, 2014 9:00 am Subject: Op Amps and ADCs using the same pin |
Thanks for the information. I am using the 16F1789 and the data sheet is not apparently as friendly. I did not see any association between the OPA module and the ADC module other than they are assoc ... |
|