>> any ideas?
R-M-W problem? ... post your code and you will get more help
>> any ideas?
R-M-W problem? ... post your code and you will get more help
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Paul is right. If you are modifying the outputs like this
PORTB = PORTB + $2
You can be sure that bit corresponding to $2 will come on, but the bits which are supposed to stay where they are may not. This is the Read-Modify-Write issue Paul is talking about. Read more about it in the datasheets
JF
Here's some code. Thanks for the help!!
@ device PIC16F876A, hs_osc, wdt_off, pwrt_off, bod_off, lvp_on, cpd_off
TRISA=%00000000
TRISB=%00000000
ADCON0=7
ADCON1=7
W VAR BYTE
TheLoop:
FOR W=1 TO 255
PWM PORTB.0,W,1
NEXT W
HIGH PORTB.0
PAUSE 1000
' As soon as I start this PWM on PORTB.1, PORTB.0 goes LOW...this is what I need to fix.
FOR W=1 TO 255
PWM PORTB.1,W,1
NEXT W
HIGH PORTB.1
PAUSE 1000
GOTO TheLoop
You don't seem to have the RBPU enabled in your code (OPTION_REG) and also you may not be having external pull ups on the PWM output pins. So, when the PWM code executes, it does the RMW routine and PortB.0 goes low. You could check on this.
JF
Bookmarks