PIC10F320/2 Errata

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

PIC10F320/2 Errata

Postby Brian Griffin » Sun Jun 30, 2013 1:22 am

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);
    }

}
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: PIC10F320/2 Errata

Postby robosang » Sun Jun 30, 2013 11:28 am

Never uses that chip, but is good to know I need to check the Errata in future. Thanks for sharing :D
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: PIC10F320/2 Errata

Postby ABSF » Mon Jul 01, 2013 10:05 pm

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
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 19 guests