> It might be necessary to modify the device files is such a
> way that for the read of a port or pin the TRIS register
> must be consulted: when configured for input read the PORT
> register, when configured for output read the LAT register.

Hummm... This is not an easy subject. A pin can change its function and be both 
input and output while running a program. So this decision would have to be 
made at runtime. That would cost some code space, and, what concernes me more, 
execution time. I wouldn't want such basic tasks like reading a pin take more 
time than neccessary. 

The read-modify-write-problems are extensively described in the PIC datasheets, 
as well as the fact that a loaded pin may read not back the value it is 
driving. 

My opinion would be, that the program using 

led=!led

is simply faulty. If one is programming a microcontroller, he should have at 
least some knowledge about electronics. If he doesn't want to care about 
hardware, programming a computer would be the choice.

Greets,
Kiste

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to