dear sir
i have some mistake
iwant to handle portA
go_sub1:
go_sub2:
go_sub3:
go_sub1:
high porta.0
goto main
go_sub2:
high porta.1
goto main
go_sub3:
high porta.2
goto main
dear sir
i have some mistake
iwant to handle portA
go_sub1:
go_sub2:
go_sub3:
go_sub1:
high porta.0
goto main
go_sub2:
high porta.1
goto main
go_sub3:
high porta.2
goto main
When performing bit write operations on PIC16s, this is something you have to watch out for.
Reading the PORTx register reads the status of the pins, whereas writing to it will write to the PORT latch. All write operations are read-modify-write operations. Therefore, a write to a port implies that the port pins are read, this value is modified and then written to the PORT data latch.
Why pay for overpriced toys when you can have
professional grade tools for FREE!!!
Many chips have analog funtions on PORTA, did you turn the ADC off?
http://www.picbasic.co.uk/forum/showthread.php?t=561
Dave
Always wear safety glasses while programming.
use 16f877a
Adc off
can u help me.with example
thank you
Did you get the main program structure working?
If it still acts funny, it's probably because the GOTO MAIN in the subroutines always goes back to the top of the program. Only SUB1 will get executed.
What about something like this?
I would recommend starting with Port B for your testing. You can use Port A later once you have a simple program working.Code:GOTO MAIN ' Skip over subroutines Sub1: high portB.0 RETURN Sub2: high portB.1 RETURN Sub3: high portB.2 RETURN MAIN: GOSUB Sub1 GOSUB Sub2 GOSUB Sub3 END
Robert
![]()
Bookmarks