Hi all !
This is my first post but this forum has been my extended manual or knowledge base for a couple of years.
I'v tried to do a array and a for next loop to addres a port(pin) where I have a DS18B20 on each pin.
Why I want a loop is to not need multiple lines of reads and calculations but a repeated read with changed port adressing.
I dont get it working with port(pin) arrays UNLESS I do a Tris first and since i do that i direct the port to be either output or input but for OWin an OWout there will be bidirectional communications.
Pbp 2.50 EasyPic 2 and 5 Microcode studio 3.0.0.5
Pic F877A
porta 0-7 all DS18b20.
Portc is leds for monitoring the states of port.
The supplied code is NOT working unless i un-rem the Tris statement.
The loop counter is working on the LCD.
This is just a test code for adressing problem.
adcon1=7 ' digital port on port A
portnr var word[8]
Deg CON 223 ' Data to display Deg ° symbol
CLR CON 1 ' CLR LCD command
LINE1 CON 128 ' LCD line #1
LINE2 CON 192 ' LCD line #2
LINE3 CON 148 ' LCD line #3
LINE4 CON 212 ' LCD line #4
INS CON 254 ' LCD command mode parameter
Sign VAR BYTE ' +/- sign for temp display
Dummy VAR BYTE ' Dummy for Div32
'Portc = %00000000 'Initiate all port c pins to low
'Trisc = %00000000 'Setup port c as all outputs
start:
lcdout ins,clr
lcdout INS,LINE1, " ++ Startup ++ "
Pause 500
for portnr = 0 to 7
pause 200
lcdout INS,LINE2, dec portnr
portc.0[portnr] = 1
pause 200
next portnr
pause 1000
goto start
Brgds Roy
Bookmarks