In your code at the top of the page you list TRISIO=%00001000. Of course GPIO.3 is MCLR and is Input only. In the previous post you state you are having problems with TRISIO=%00100000. It's probably not your issue, but try TRISIO=%00101000.
In your code at the top of the page you list TRISIO=%00001000. Of course GPIO.3 is MCLR and is Input only. In the previous post you state you are having problems with TRISIO=%00100000. It's probably not your issue, but try TRISIO=%00101000.
It does not helps. And I'm not using MCLR pin for anything except programming. Tried TRISIO=%00101000 but that does not helps. Tried disabling MCLR from config, also no change. Making a pin input creates issues with others being output.
Did you try a new PIC? I've never seen what you're describing. Thinking something internal might be whacked.
its a classic rmw problem.
can also be caused by excessive load on output pin (capacitive or resitive) causing pin to not achieve proper logic level.
Warning I'm not a teacher
Yes tried new chip. Output pins are connected to MPSA42 transistor via 10K resistor.
If I swap chip with 12F1840, will problem still exist?
I decided to put it aside, to give my mind some rest, and back to DS3231.
I found that it does not return seconds properly.
Have two different example codes, they work fine for minutes and hours, but does not work for seconds - seconds increase like 02 04 08 10 12 14 16 till 28, then 29 and again increase in 2 and so on.
Code:SecondsMSB=BCDSeconds & $70 SecondsMSB=SecondsMSB>>4 SecondsLSB=BCDSeconds & $0F ' Seconds=(SecondsMSB*10)+SecondsLSB 'combines DECMinutes MSB and LSB x=RTCSEC >> 4 Y=RTCseC // 16 z=X*10+Y
more than likely , you need to understand and remedy the situation.If I swap chip with 12F1840, will problem still exist?
http://www.picbasic.co.uk/forum/showthread.php?t=15843&highlight=shadow
http://www.picbasic.co.uk/forum/showthread.php?t=15013&highlight=shadow
and post your code and a schematic so we don't just keep guessing
Warning I'm not a teacher
I tried to replace HIGH/LOW statements with TRISIO.X=1 or 0, it does not helps. In fact, say TRISIO.0=1 does not make GPIO.0 pin high.
Bookmarks