Hi people, Long rundown on specific device latch up condition. Just a thought for those going to try and use the 40 Pin PICs for the first time. The C64 (and others) have a parallel slave port on port D using port E as control signals. Well I used port E as control signals (outputs) for a alpha numeric LCD display and used port D to read in a simple DIP switch (the LCD data was on port B). All this is great. The problem comes up when you don't read the data sheet and check out what the remaining TRISE bits do. I am used to setting unimplemented bits in a port into the input state (bits in TRIS set) and using the low 3 implemented bits of port E as output I set the rest high and used 0xf8 for the TRIS value. This causes some realy hard to detect problems. The data sheet says one should program the port E pins to input if using the parallel slave mode which is selected from the same TRIS register. I had inadvertently turned on the parallel slave mode and set the pins to outputs. Usually there was no problem but if there was a intemediate power brown out or noise on the supply when coming up it was likely that port D would get stuck in some kind of wierd mode between normal and parallel slave mode and not read properly. Using a hard reset did not clear the condition and the usual drop the voltage to 4V so the reset generator kicked in was also not sufficient and I had to wait for the supply to go to ground before this funny mode was cleared. The only reason I noticed this was because I was writing the dip switch value onto the LCD when debugging which was working fine but the value read from the switches was badly corrupt. I understand that I did put the device into a mode that was not allowed but even so when it occasionally did latch up port D the condition was not cleared by a firm reset. It is starting to look like there is a pattern with quite a few strange modes and periferal latchups that are impossible to clear without a deep power down cycle. This is very hard for a program to detect or remedy, having a watchdog driven powersupply crowbar circuit does seem a bit extreme. Cheers -- Kalle Pihlajasaari kalle@ip.co.za http://www.ip.co.za/ip Interface Products P O Box 15775, DOORNFONTEIN, 2028, South Africa + 27 (11) 402-7750 Fax: 402-7751 http://www.ip.co.za/people/kalle DonTronics, Silicon Studio and Wirz Electronics uP Product Dealer