problems with 16f1827 and 16f1823 pwm output pins with mplab sim

Author
person66
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2012/02/27 10:08:25
  • Location: 0
  • Status: offline
2012/02/27 11:10:01 (permalink)
0

problems with 16f1827 and 16f1823 pwm output pins with mplab sim

Hi All, Its my first message on this forum; Sorry for my english, I am french person. So, I want to use eccp1 on 16f1827 and on 16f1823 : full bridge mode. First of all, I run piece of c code delivered by microchip with pickit3 : "12 CPP PWM" : it works on a 18f45k20 perfectly simulated with mplab sim. 1st part : 16f1827 I modified previous piece of software to run with a 16f1827 (tries in asm and c) I use simulator to check ouputs : ie P1A(RB3), P1B(RB5), P1C(RB6) and P1D(RB7). I noticed that simulator displays correctly signals on RB3 and RB5 but nothing on RB6 and RB7 ? Since I put all pins as outputs, I discovered that the 2 last signals were displayed on pins RA7(for RB6) and RA6(for RB7) ? Dont'understand ? 2nd part : 16f1823 I modified previous piece of software to run with a 16f1823 (wrote in asm only) I use simulator to check ouputs : ie P1A(RC5), P1B(RC4), P1C(RC3) and P1D(RC2). Then I don't see pwm working correctly with simulator in reverse mode(forward mode is ok) - signals on ECCP are ok but - P1C (RC3) is modulated instead of P1B (RC4) - P1B (RC4) is inactived - RA5 is activated ! Here is the code of 16f1823: BANK1 movlw 0 movwf TRISC movwf TRISA movwf OPTION_REG movwf INTCON movwf PIE1 movlw 0x20 BANK5 movwf CCPR1L movlw B'01001100' ; enhanced pwm in full bridge output forward ;movlw B'11001100' ; enhanced pwm in full bridge output reverse movwf CCP1CON ; BANK0 movlw 0xfe movwf PR2 movlw B'00000111' movwf T2CON I probably made a mistake... but where ? Thanks for your help
#1

0 Replies Related Threads

    Jump to:
    © 2017 APG vNext Commercial Version 4.5