Keong wrote: > Hi > > I notice that the program memory for the PIC12CE518 is > organised in 512x12 blocks, rather than the normal x14 > blocks. Is there any difference in its usage as > compared to those using x14 block program space or are > there any particular steps that I need to take into > account when writing the program for the chip that is > using 12 bits per program memory space (PIC12CE518). The 512 word blocks are "normal" for all the low-end PICs - the 12C series and the 16C5x. (I wouldn't bother with the 16C5x series for any new designs, though; use a mid-range PIC instead. The price difference is negligible.) Since the 12CE518 only has 512 words of program memory, you don't need to worry about any interpage issues on that processor. Just in case you try some of the low-end chips with more program memory, though... If your program is 512 bytes or less, there isn't anything special you will need to do. If it's larger, you have to deal with interpage jumps. They're handled differently than on the mid-range PICs. There is no PCLATH register; instead, you use bits PA0 and PA1 of the status register. CALL instructions only have 8 address bits, so they can't access the second half of a memory page. Therefore, you have to put subroutines in the first half of each page. Another difference is access to registers. There are only five bits of address for registers in the 12-bit instructions, so you can only see 32 at a time; rather than the RP0 and RP1 bits of the status register, you use the FSR register. Remember those TRIS and OPTION instructions that Microchip keeps trying to convince you not to use? Well, on the low-end chips, you MUST use them; they're the only way to get at the TRIS and OPTION registers. Other differences: the reset vector goes to the highest memory location, not address 0. (One simple way to work around that is to put a NOP at the top of memory, and pretend that the reset goes to address 0 as usual.) There are no addlw and sublw instructions. Finally, if you're using a part with a built-in oscillator, don't forget to save the calibration value, and write it with your program code! (The 16F628 makes life so much easier that way, with the calibration info safely hidden from users. Or maybe they just found a way to get rid of enough process variation that they don't need one any more.) -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body