Page 1 of 1

PIC10F320/2 Errata

PostPosted: Sun Jun 30, 2013 1:22 am
by Brian Griffin
Some days ago I just received these little PIC10Fs and I tested these with a blinking LED as a start using XC8.

Nope, it didn't work. Wondering whether I left out anything else inside. Checked: config words, connections, all OK.

Then I begin to search, and found out that I happened to received these PIC10F320 which are engineering samples (Revision 1) and should not exist in my own hands. I should have Revision 2 instead. The RAM locations in all my PIC10F320 are all wrong. :evil:

Luckily I read these links:
http://www.microchip.com/forums/m654174-print.aspx
http://www.microchip.com/forums/m623700.aspx
http://www.microchip.com/forums/m647383.aspx

and most suggested that I should compile the XC8 in a different RAM location, which is at 0x60~0x7f.

So, to (temporarily) fix that, I went to the File->Project Properties->XC8 Global Options->XC8 Linker, and then on the dropdown menu Option Categories, select Memory Model. On the RAM ranges, fill in default,-40-5f. It prevents the compiler from using the wrong memory location. Recompile the code after you change the memory ranges.

Here's the simple code, and these chips are slightly defective with the wrong memory location. I might want to return them to the store and demand for a replacement. The sample code for LED blinking on the PIC10F320 is as follows.

CODE: SELECT_ALL_CODE
#include <xc.h>

#define _XTAL_FREQ 4000000

__CONFIG(FOSC_INTOSC & BOREN_OFF & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & CP_OFF & LVP_OFF & LPBOR_OFF & BORV_LO & WRT_OFF);

void init() {

    CLKRCONbits.CLKROE = 0;     // Reference clock disabled
    OSCCONbits.IRCF2 = 1;      // 4mhz internal oscillator
    OSCCONbits.IRCF1 = 0;
    OSCCONbits.IRCF0 = 1;
    ANSELA = 0x00;              // all ports are digital for A/D
    TRISA = 0x00;
   
}

void main() {

    init();

    while(1) {

    PORTAbits.RA1 ^= 1;
    __delay_ms(500);
    }

}

Re: PIC10F320/2 Errata

PostPosted: Sun Jun 30, 2013 11:28 am
by robosang
Never uses that chip, but is good to know I need to check the Errata in future. Thanks for sharing :D

Re: PIC10F320/2 Errata

PostPosted: Mon Jul 01, 2013 10:05 pm
by ABSF
Thanks for the info. Recently I used a few 10Fxxxx to experiment with mTouch. But mostly I prefer to use the 12F series than the 10F.

Allen