Resistor-led-pin, that's all![]()
Resistor-led-pin, that's all![]()
Strange, and how to write PORTA in whole? like this?
PORTA=%00000001
?
It does not work, even setting PORTA.1=1 does nothing
Try
Code:SIKO: PORTA=%00000011 PAUSE 500 PORTA=%00000000 PAUSE 500 GOTO SIKO
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Everybody together now:
Remember to disable analog functions...
Remember to disable analog functions...
Remember to disable analog functions...
/Henrik.
628A has analog functions?
P.S. I do have CMCON disabled...
Yes it does, the comparators are analog and enabled by default.628A has analog functions?
Your code doesn't show that. What does having CMCON disabled mean? What are you writing to it?P.S. I do have CMCON disabled...
From the datasheetWhen you do stuff likeThe PORTA pins are multiplexed with comparator and
voltage reference functions. The operation of these
pins are selected by control bits in the CMCON
(Comparator Control register) register and the VRCON
(Voltage Reference Control register) register. When
selected as a comparator input, these pins will read
as ‘0’s.All bit operations on a register is performed as a read-modify-write operation. The port is read, modified and written back - it's the way it works inside the PIC itself. If the read operation returns a state of a pin that is different to what you set then that erroneous state will be written back to the port and you get "weird" and "unexpected" results. Having analog functions enabled is THE most (un)popular cause of this happening.Code:PortA.0 = 1 PortA.1 = 1
Having too much load, or a capacartive load on the actual output is another cause. In this case the voltage level at the pin isn't allowed to rise to a level where the read operation of the second command actually "gets" a logic 1.
/Henrik.
If you Google read modify write you'll find loads and loads of explainations.
Bookmarks