PIC12F509-E/MC Microchip Technology, PIC12F509-E/MC Datasheet
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
PIC12F509-E/MC
Specifications of PIC12F509-E/MC
Related parts for PIC12F509-E/MC
PIC12F509-E/MC Summary of contents
Page 1
... Memory Programming Specification This document includes the programming specifications for the following devices: • PIC12F508 • PIC12F509 1.0 PROGRAMMING THE PIC12F508/509 The PIC12F508/509 is programmed using a serial method. The Serial mode will allow the PIC12F508/509 to be programmed while in the user’s system. This ...
Page 2
... The PC will increment from (0x000-0x1FF) and (0x000-0x3FF), respectively, then to 0x200 and 0x400, respectively (not to 0x000). In the configuration memory space, 0x200-0x23F for the PIC12F508 and 0x400-0x43F for the PIC12F509 are physically implemented. However, only locations 0x200-0x203 and 0x400-0x403 are available. Other locations are reserved. ...
Page 3
... The programming sequence loads a word, programs, verifies and finally increments the PC. Program/Verify mode entry will set the address to 0x3FF for the PIC12F508 and 0x7FF for the PIC12F509. The Increment Address command will increment the PC. The available commands are shown in Table 3-1. FIGURE 3-1: ...
Page 4
... READ DATA FROM PROGRAM MEMORY COMMAND ICSPCLK ICSPDAT T 1 SET DS41227E-page DLY LSb strt_bit DLY 1 HLD T 2 DLY strt_bit LSb T 1 DLY T 1 HLD input Preliminary MSb stp_bit T 1 SET HLD DLY MSb stp_bit input output © 2007 Microchip Technology Inc. ...
Page 5
... A timing diagram of this command is shown in Figure 3- not possible to decrement the address counter. To reset this counter, the user must either exit and re-enter Program/Verify mode or increment the PC from 0x3FF for the PIC12F508 or 0x7FF for the PIC12F509 to 0x000. FIGURE 3-4: INCREMENT ADDRESS COMMAND 1 ...
Page 6
... Enter Program/Verify mode. 3. Increment PC to 0x200/0x400 (first user ID location). 4. Perform a Bulk Erase command. 5. Wait T to complete Bulk Erase. ERA 6. Restore OSCCAL bits. 7. Restore backup OSCCAL bits. oscillator Preliminary DIS Next Command 1 2 © 2007 Microchip Technology Inc. ...
Page 7
... BULK ERASE RESULTS Program Memory Space PC = Program Memory Configuration Word or E Program Memory Space First User ID Location E FIGURE 3-7: BULK ERASE PROGRAM MEMORY COMMAND 1 2 ICSPCLK 1 ICSPDAT T 1 SET T HLD © 2007 Microchip Technology Inc. Configuration Memory Space Configuration Reset Vector Word Preliminary ...
Page 8
... Increment Address Increment Address DS41227E-page 8 Start Enter Programming Mode 0x1FF/0x3FF? Yes Read Calibration Bits and Save in Computer/Programmer Temp. Memory 0x204/0x404? Yes Read Backup OSCCAL Calibration Bits and Save in Computer/Programmer Temp. Memory Exit Programming Mode Done Preliminary © 2007 Microchip Technology Inc. ...
Page 9
... FIGURE 3-9: RESTORING/PROGRAMMING THE OSCCAL CALIBRATION BITS Increment Address Increment Address © 2007 Microchip Technology Inc. PIC12F508/509 Start Enter Programming Mode 0x1FF/0x3FF? Yes Read Calibration Bits from Computer/Programmer Temp. Memory Write Calibration Bits back as the operand of a MOVLW instruction to 0x1FF/0x3FF 0x204/0x404? ...
Page 10
... Mode Restore 0SCCAL bits Figure 3-9 ( Program Configuration Memory Figure 3-11 ( Done DS41227E-page 10 ) Report No Programming Failure Yes ) ) Preliminary PROGRAM CYCLE Load Data for Program Memory Begin Programming Command (Externally timed) Wait T PROG End Programming Wait T DIS © 2007 Microchip Technology Inc. ...
Page 11
... Correct? Yes Increment Address Command No Address = 0x200/0x400? Yes Load Data Command One-Word Programming Cycle (see Figure 3-10) © 2007 Microchip Technology Inc. PIC12F508/509 Programs Configuration Word Report Programming Failure Programs User IDs Read Data Command Report No Data Programming Correct? Failure Yes ...
Page 12
... PROGRAM FLOWCHART – ERASE PROGRAM MEMORY, CONFIGURATION WORD Start Read and save OSCCAL bits ( Figure 3-8 ) Enter Program/Verify mode PC = 0x3FF/0x7FF (Config Word) DS41227E-page 12 Bulk Erase Device Wait T ERA Restore OSCCAL bits ( Figure 3-9 ) Exit Programming Mode Done Preliminary © 2007 Microchip Technology Inc. ...
Page 13
... FIGURE 3-13: PROGRAM FLOWCHART – ERASE PROGRAM MEMORY, CONFIGURATION WORD AND USER ID Start Increment PC © 2007 Microchip Technology Inc. PIC12F508/509 Read and save OSCCAL bits ( Figure 3-8 ) Enter Program/Verify mode PC = 0x3FF/0x7FF (Config Word 0x200/0x400? (First User ID) Yes Bulk Erase Device Restore OSCCAL bits ...
Page 14
... LP oscillator oscillator 10 = INTOSC 11 = EXTRC Legend Readable bit W = Writable bit - n = Value at POR ‘1’ = Bit is set DS41227E-page 14 — — — MCLRE Unimplemented bit, read as ‘0’ ‘0’ = Bit is cleared Preliminary CP WDTE FOSC1 FOSC0 bit Bit is unknown © 2007 Microchip Technology Inc. ...
Page 15
... ID information must be included. An option to not include this information may be provided. Microchip Technology Incorporated feels strongly that this feature is important for the benefit of the end customer. © 2007 Microchip Technology Inc. PIC12F508/509 5.3 Checksum Computation 5.3.1 CHECKSUM Checksum is calculated by reading the contents of the ...
Page 16
... For example, ID0 = 0x1, ID1 = 0x2, ID2 = 0x3, ID3 = 0x4, then SUM_ID = 0x1234. *Checksum = [Sum of all the individual expressions] MODULO [0xFFFF Addition & = Bitwise AND Note 1: Checksum shown assumes that SUM_ID contains the unprotected checksum. TABLE 5-2: CHECKSUM COMPUTATIONS – PIC12F509 Device Code-Protect PIC12F509 OFF SUM[0x000:0x3FE] + CFGW & 0x01F ON SUM[0x00:0x3F] + CFGW & ...
Page 17
... PP ND mode by applying Legend: TBD = To Be Determined. Note 1: Minimum time to ensure that function completes successfully over voltage, temperature and device variations. © 2007 Microchip Technology Inc. Standard Operating Conditions (unless otherwise stated) Operating Temperature Operating Voltage Min. Typ. 4.5 — 4.5 — ...
Page 18
... PIC12F508/509 NOTES: DS41227E-page 18 Preliminary © 2007 Microchip Technology Inc. ...
Page 19
... PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. ...
Page 20
... Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 Preliminary © 2007 Microchip Technology Inc. EUROPE Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 France - Paris Tel: 33-1-69-53-63-20 ...