PDA

View Full Version : PWM on PIC16F1937



Rony
- 21st April 2016, 14:42
Hi guys,

i need to run 3 PWM using the PIC16F1937, all at the same frequency.
I am trying at the first stage to use CCP1 and it is not working.
Below the registers i wrote:
APFCON = %01100000
PORTA = %00000000
PORTB = %00000000
PORTC = %00000000
PORTD = %00000000
PORTE = %00000000
TRISA = %00110101
TRISB = %00000001
TRISC = %00110001
TRISD = %00000000
TRISE = %00000000
ADCON0 = %00000000
ADCON1 = %00000000
ANSELA = %00000001
ANSELB = %00000000
ANSELD = %00000000
INTCON = %00100000
PIR1 = %00000000
PIR2 = %00000000
PIR3 = %00000000
PIE1 = %00000010
PIE2 = %00000000
OPTION_REG = %00000001
WPUB = %00000011
T1CON = %00000000
T2CON = %00000110
PR2 = %11111111
CCP1CON = %00001100
CCPTMRS0 = %00000000
CCPTMRS1 = %00000000
PSTR1CON = %00000001
PWM1CON = %00000000
ECCP1AS = %00000000
CCPR1L = 100

anyone can help ?

Thanks
Rony

Art
- 1st June 2016, 19:08
Have you tried getting PBP to start it?
You could then read back the values of the registers that can be read which is probably most of them.

Ioannis
- 7th June 2016, 07:48
The idea to have PBP setup the registers is good if you need 8 bit PWM. But is a start anyway...

Ioannis