Comment #3 on issue 169 by [email protected]: Flipping a pin with the 18F PICs
http://code.google.com/p/jallib/issues/detail?id=169
Matt:
I disagree, this is not a faulty program. Flipping a led should be allowed just like any other variable.
A LED is not a variable, but a device connected to a peripheral, a port in this case. A pin configured as input can not be flipped, neither can read- or write-only bits be flipped (think of TXREG or the like).
A LED can be a heavy load. Ports F,G,H and bits 0-5 of port A can sink or source 2mA, ports D,E and J can sink or source 8mA. Only ports B,C and bits 6-7 of port A can sink or source the "usual" 25mA.
To reliably read "low", the voltage must be below about 0.8V. Driving one of the "strong" outputs low, the voltage will rise to a max of 0.6V at 8.5mA - while LEDs are often driven with much more than 8.5mA. Thus the datasheet does not state clearly that a pin driving a value at more than 8.5mA can reliably read the driven value back.
Does the LED blink if you're using a resistor of, say, 5kOhm? You'll have to look closely... ;-)
-- 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.
