PIC16F88 program PicBasic pro 2.54

Thread Starter

aGpLT

Joined Jan 21, 2010
128
' RB0 and RB1 are for PWM
' RB2 is for SD

ANSEL = %00000000 ' All pins changed from analogue to digital
OSCCON = $60 ' Internal clock setted to 4Mhz
TRISB = %00000000 ' All PORTB pins are outputs.
HIGH PORTB.2 ' Turn on sd pin to shutdown ir2110

start:
Pause 100 ' Delay for 100ms waiting for mosfets to settle
low PORTB.2 ' Turned off sd pin
Pause 100 ' delay 100ms
PWM PORTB.0,242,255 ' Pulse sent to PORTB.0 at a duty 'value of 242(95% duty cycle) for 255 cycles.
PWM PORTB.1,012,255 ' Pulse sent to PORTB.0 at a duty 'value of 12(5% duty cycle) for 255 cycles.
PAUSE 100
PWM PORTB.0,127,255 ' 50%
PWM PORTB.1,127,255 ' 50%
PAUSE 100
PWM PORTB.0,012,255 ' 5%
PWM PORTB.1,242,255 ' 95%
PAUSE 100
PWM PORTB.0,127,255 '50%
PWM PORTB.1,127,255 '50%
PAUSE 100
GOTO start
END
who could help me to correct program ? i want to drive motor to one side correctly with PWM.
 
Last edited:

retched

Joined Dec 5, 2009
5,207
Does that say GOTO?

wow, havent seen that in years.
One thing that jumps out at me, this:
PWM PORTB.1,012,255 ' Pulse sent to PORTB.0 at a duty 'value of 12(5% duty cycle) for 255 cycles.
The remark says PORTB.0 but the code says PORTB.1
 

Thread Starter

aGpLT

Joined Jan 21, 2010
128
Does that say GOTO?

wow, havent seen that in years.
One thing that jumps out at me, this:


The remark says PORTB.0 but the code says PORTB.1
Heh this is copy paste mistake :> sorry with this, i think i didn't really needed to vreate thread here, the thread where i am w8ing for answer is in general electronics forum. If you dont mind, can you read a little ? maybe you will know where is problem :) i would be very grateful :)

http://forum.allaboutcircuits.com/showthread.php?t=38559
 
Top