Hi Bruce thank you for reply, It is not working. I think something is wrong or missing for this situation.
Hi rodstar, that is possible. Deadtime is very important for me. I have to put a deadtime in the PWM signals.
Hi Bruce thank you for reply, It is not working. I think something is wrong or missing for this situation.
Hi rodstar, that is possible. Deadtime is very important for me. I have to put a deadtime in the PWM signals.
Is it still only showing a PWM signal on P1A? Are you running this in ISIS or on a real PIC?
More info would help.
Edit: I ran this through MPSIM with the logic analyzer on P1A and P1B. Sure looks like it works.
Screen capture of MPSIM logic analyzer attached.Code:DEFINE OSC 20 Duty VAR WORD ' 5%=25, 95% = 450 TRISC.2=0 TRISD.5=0 T2CON = %00000101 ' Timer2 ON, prescale 1:4 PR2 = 124 ' 10kHz CCP1CON = %10001100' half-bridge with P1A & P1B PWM1CON = %10001111' set dead-time Loop: For Duty = 25 TO 450 ' from 5% to 95% duty CCP1CON.4 = Duty.0 ' Setup 10-bit duty cycle as CCP1CON.5 = Duty.1 ' a 10-bit word CCPR1L = Duty >> 2 PAUSEUS 24 Next Goto loop End
Might be a problem with ISIS or your config settings?
Last edited by Bruce; - 31st October 2007 at 21:04.
Hi Bruce , Thank you for interest.
The problem is not simulation. I have just tried your code on the proto board. It is not working. I programmed your code. Nothing was changed.
Did you use some fuse setting that i didn't see in your code. I think something is wrong with this PIC model because my 18F458 and 16f690 and 16f684 is working Half bridge Mod properly in ISIS and proto board.
Thank you again.
Here's the config settings I used when running this through MPSIM.
__CONFIG _CONFIG1H, _OSC_HS_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
I have attached the .hex & .bas files I used.
After looking at one of many errata sheets for the 18F4620, I doubt I'll be in
any huge hurry to try this one.
The Rev A silicon Errata sheet shows a boat-load of problems with the ECCP
module. It could very well be a silicon bug. Good luck...;o}
Thank you very much for valuable helps. The last code was the same. I will research more. Maybe one mounth later i will work with other PIC wich have not got big bugs if I can't succeed.
Best regards.
18F458 is working very well with the same code but 18F4620 is not. I think there is a PIC bug.
Bookmarks