Re: portA.0 cannot be set
Do you have the pins connected to anything? It smells like the good old Read-Modify-Write problem...
What if you try:
Code:
trisa=0
main:
porta.0=0
Pause 1 'Allow PortA.0 to settle low.
porta.1=0
pause 10
porta.0=1 'Allow PortA.0 to settle high
Pause 1
porta.1=1
pause 10
goto main
HIGH and LOW also resets the corresponding bit in the TRIS register (making the pin output) for you so even if you have the pin setup as an input doing HIGH PortX.x will switch it to an ouptut and set it high. I'm not sure WHY it matters in THIS case but we can figure that out IF it turns out to BE a RMW-problem.
/Henrik.
Re: portA.0 cannot be set
You will need to turn the ADC off.
ADCON1 = 15
Re: portA.0 cannot be set
Henrik,
It was a read-write-modify issue.
a simple PAUSEUS 1 between instructions solved it.
Thanks!
Re: portA.0 cannot be set
Bonjour Patrice,
Or simply Write " HIGH or LOW PortA.0 " ... it will automatically add a little time ... ( equal to TRISA.0 = 0 ... )
hé,hé ... soyons flemmards !!!
Alain
Re: portA.0 cannot be set
Bonjour Alain,
You are right, I had noticed that writing "high" or "Low" indeed worked as well.
This is the first time I design a project running at 40 Mhz, so I am dealing with new issues I have not seen before.
You learn every day!
A+
Pat
Re: portA.0 cannot be set
Salut Patrice,
With PIC18, there's LAT port made to avoid this problem
You write to LAT ... but read from PORT
LATA.0=1
LATA.1=1
LATA.2=1
LATA.3=1