
Originally Posted by
SOTASOTA
I would like to know more about "LATs". Know zero. Does PIC Basic Pro support these? Tell me more please! Sounds interesting!!
Hi,
Lat is short for latch. I not a good communicator, so I can't explain it better than the data sheet. The main thing to understand is that on the older pic16's we used portx.x to read or write to a pin. This could lead to R-M-W problem that Henrik pointed out. On the new pic16fxxxx,pic12fxxxx, pic18, dspic, and pic32 we use Latx.x to change the output. Portx.x is used to read a port pin. So on the above code you provided.
Code:
Low PORTA.1
Low PORTA.4
PORTA.1 = 1
pause 1000
PORTA.4 = 1
pause 1000
PORTA.4 = 0
PORTA.1 = 1
This is how it should be, as someone pointed out in the other thread.
Code:
Low LATA.1
Low LATA.4
LATA.1 = 1
pause 1000
LATA.4 = 1
pause 1000
LATA.4 = 0
LATA.1 = 1
Here a similar thread
http://www.picbasic.co.uk/forum/showthread.php?t=15836
Bookmarks