You need to log in to create posts and topics.
New little bug in pic 16f676
percoco2000@percoco2000
13 Posts
#1 · November 22, 2025, 8:47 am
Quote from percoco2000 on November 22, 2025, 8:47 amPlaying with the ADC of this pic, i encountered this little bug:
in the file "p16F676.mcu' the value of ADCON1 is wrongly set to 1Fh, instead of 9Fh.
This way the ADC conversion doesn't work. Inserting the right value solves the issue
The wrong code:
<!-- BANK 1 --> <regblock name="SFR1" start="0x009E" end="0x0009F" > <register name="ADRESL" addr="0x9E" bits="" /> <register name="ANSEL" addr="0x91" reset="11111111" /> <register name="ADCON1" addr="0x1F" mask="01110000" bits="0,0,0,0,ADCS0,ADCS1,ADCS2"/> </regblock>
The correct code:
<!-- BANK 1 --> <regblock name="SFR1" start="0x009E" end="0x0009F" > <register name="ADRESL" addr="0x9E" bits="" /> <register name="ANSEL" addr="0x91" reset="11111111" /> <register name="ADCON1" addr="0x9F" mask="01110000" bits="0,0,0,0,ADCS0,ADCS1,ADCS2"/> </regblock>
Playing with the ADC of this pic, i encountered this little bug:
in the file "p16F676.mcu' the value of ADCON1 is wrongly set to 1Fh, instead of 9Fh.
This way the ADC conversion doesn't work. Inserting the right value solves the issue
The wrong code:
<!-- BANK 1 -->
<regblock name="SFR1" start="0x009E" end="0x0009F" >
<register name="ADRESL" addr="0x9E" bits="" />
<register name="ANSEL" addr="0x91" reset="11111111" />
<register name="ADCON1" addr="0x1F" mask="01110000"
bits="0,0,0,0,ADCS0,ADCS1,ADCS2"/>
</regblock>
The correct code:
<!-- BANK 1 -->
<regblock name="SFR1" start="0x009E" end="0x0009F" >
<register name="ADRESL" addr="0x9E" bits="" />
<register name="ANSEL" addr="0x91" reset="11111111" />
<register name="ADCON1" addr="0x9F" mask="01110000"
bits="0,0,0,0,ADCS0,ADCS1,ADCS2"/>
</regblock>
Click for thumbs down.0Click for thumbs up.0
arcachofo@arcachofo
912 Posts
#3 · November 29, 2025, 6:02 pm
Quote from percoco2000 on November 29, 2025, 6:02 pmJust to inform you, the file on the git repository is still bugged
Just to inform you, the file on the git repository is still bugged
Click for thumbs down.0Click for thumbs up.1
arcachofo has reacted to this post.
arcachofo
