View previous topic :: View next topic |
Author |
Message |
lokken
Joined: 21 Feb 2010 Posts: 17
|
A question about ECCP[Solved] |
Posted: Mon Jan 31, 2011 2:25 am |
|
|
Does PWM frequency reduce in ECCP mode?
I calculated the PWM frequency as 20 Khz.
I wrote this code shown below. But I get 5khz signal at the output of the P1D. Is it normal?
My codes; (My compiler version is 4.114)
Code: |
#include <18f14k50.h>
#include <PIC18f14k50_registers.h>
#FUSES NOWDT,INTRC_IO,NOPUT,NOBROWNOUT,NOLVP,NOCPD,NOMCLR,NODEBUG
#use delay(clock=4000000)
void main()
{
TRISC=0b00000010;
PORTC=0;
t2con=0b00000100;
ccp1con=0b00001100;
pstrcon=0b00001000;
pr2=50;
CCPR1L=10;
while(true){}
}
|
Thanks
Last edited by lokken on Wed Feb 02, 2011 9:52 am; edited 1 time in total |
|
|
lokken
Joined: 21 Feb 2010 Posts: 17
|
|
Posted: Wed Feb 02, 2011 8:12 am |
|
|
Is there anyone to answer my question? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Wed Feb 02, 2011 9:00 am |
|
|
1) Is this a real chip with a 'scope looking at the signal or a simulation(proteus ?)?
2) you should use the CCS functions for setting peripherals up, I doubt many will want to take the time to figure out what ,for example...ccp1con=0b00001100 translates to. |
|
|
lokken
Joined: 21 Feb 2010 Posts: 17
|
|
Posted: Wed Feb 02, 2011 9:52 am |
|
|
Ok I solved. It is all about my PIC programmer. Thanks for consideration. |
|
|
chungtn
Joined: 25 Jun 2010 Posts: 3
|
How to setup ECCP modul of 16f716 |
Posted: Thu Aug 18, 2011 12:55 am |
|
|
I don't know how to setup ECCP module.
Can you give me a sample program or help me setup this? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 18, 2011 1:53 pm |
|
|
1. What ECCP mode do you want ? Full-Bridge, or Half-Bridge, or what ?
2. What is your CCS compiler version ? |
|
|
|