You need to log in to create posts and topics.

New little bug in pic 16f676

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>

 

Hi.

Thanks for reporting this issue, and for the solution.