I am now building my robot and I have found an issue in the compiler.
I am controlling a L293d but it was not working. Ports on the PortC device are staying HIGH. I have simplied the code to reproduce the error.
In the code below Portc.1 is turned on, and should not turn off but when programmed it does. The ASM is below.
#chip 16F1829, 4
#config osc = xt, MCLRE_OFF
dir PORTC.0 out
dir PORTC.1 out
dir PORTC.3 out
Dir PORTC.4 out
set PORTC.3 ON
Set PORTC.4 ON
wait 1 s
do
SET PORTC.4 OFF
SET PORTC.3 ON
SET PORTC.1 ON
' PORTC.0 = 0
wait 1 s
SET PORTC.4 ON
SET PORTC.3 ON
'PORTC.1 = 0
' PORTC.0 = 1
Wait 1 s
loop
I am now building my robot and I have found an issue in the compiler.
I am controlling a L293d but it was not working. Ports on the PortC device are staying HIGH. I have simplied the code to reproduce the error.
In the code below Portc.1 is turned on, and should not turn off but when programmed it does. The ASM is below.
ASM
You may be experiencing the Read Modify Write issue. Instead of writing to PORTC write to LATC.
i.e.
set LATC.3 ON
I will give this a try and test.