On Fri, 26 Dec 1997 00:37:50 +0100 ZyLog writes: >Hi PIC_World ! > >Is someone know if then 12c50x or 16c84 have problemes with internal >RAM >on Power On Reset ? > >What happen if i try to read an address not previously initialized ? After power has been off, the RAM will start up holding "random" values. As long as the Vdd voltage is kept above 1.5V, nothing other than writes by software is supposed to change the RAM. I haven't tried much of this to see if there's a "problem". It's good practice to assume that the contents of RAM could change at any time from a "glitch" and write the program to minimize the damage if this happens. For example, say you need to output a shifting 1 bit to a port to scan a keyboard or display. So you keep a RAM variable of the last value output. A routine is needed to shift the 1 one position to the left, rolling it over to bit 0 when it reaches the end. This routine is compact, but unreliable in case of RAM disruption: clrc ;Shift in a 0. rlf scanbit,f ;Do the shift. skpnc ;Skip if 1 didn't come out. rlf scanbit,f ;If 1 came out, put it to bit 0. If the RAM location 'scanbit' contains a value other than one of the form having a single 1 and 7 zeros, it won't work. Now consider this routine: clrc ;Shift in a 0 rlf scanbit,f ;Rotate it in. movf scanbit,f ;Test if new value is 0 skpnz ;It's not, shifted value OK. bsf scanbit,0 ;Reset scan to first bit. This routine will "count out of" a bad value in scanbit within 8 shifts. So some of the scans after a RAM glitch are bad, but the PIC doesn't continue indefinitely with faulty data like it would with the first routine. >Is RAM locations are lost on a wake-up from sleep ? >After a MCLR, is RAM cleared ? Sleep mode, MCLR or watchdog resets do not affect it. MCLR resets many of the special registers, but not the data RAM.