1. Look carefully at the RAM MEMORY MAP. The last 16 bytes of each bank in the 16F87x family are mirrored in various ways. I don't remember if the 877 and 67 were the same in this respect. 2. Could you have an unknown dependency on the power-up state of a variable? Try randomizing registers (if MPLAB supports that) in the emulator and see if it breaks it. You could try clearing all used variable space at startup so that the ICE and the DEVICE both start from a known state every time; whether power-up, reset or WDT timeout. IF that makes the ICE and the DEVICE act the same, then there is probably a dependency. At 06:03 PM 7/17/01, you wrote: >Hello List > >I'm taking an existing circuit board from the 16C67 to the 16F877. >Everything seems to work normally except for a bit-banging routine which >manually controls an RS-232 driver (the USART is tied up elsewhere). For >some reason, the 232 communication fails frequently on the 877 but not on >the 67. To make matters more confusing, this problem only occurs with >burned chips, and does not occur on the MPLAB ICE. The 232 handling is NOT >going through the USART -- it is being handled directly by code. > >As far as I know, the only code differences that are necessary to move over >to the 877 are the following initialization commands: > > > bsf ADCON1, PCFG2 ; the F877 automaitically configures > bsf ADCON1, PCFG1 ; certain pins as AtoD. This makes all the pins >digital. > > > clrf PIR2 ; added for 877 > clrf ADCON0 > >page_2 ; added for 877 > clrf p2_EEDATA > clrf p2_EEADR > clrf p2_EEDATH > clrf p2_EEADRH > > page_3 ; added for 877 > clrf p3_EECON1 ; disables writes to onboard EEPROM > clrf p3_EECON2 > >My initial suspicion was that some register was not being initialized >properly. My thought is that the Emulator initializes unspecified registers >differently than the ProMate programmer and that this explains why the one >fails where the other succeeds. However, I have examined every register and >bit which differs between the two units and I believe that I have addressed >whatever differences exist. > >I have checked and triple-checked the ProMate settings. Stepping through >code is of limited use since it works on the Emulator and not on the burned >chip. > >Any ideas? > >A million thanks, > >Barnaby Thieme >Product Engineer, SP Controls, Inc. >bthieme@spcontrols.com > >-- >http://www.piclist.com hint: The list server can filter out subtopics >(like ads or off topics) for you. See http://www.piclist.com/#topics Jerry Merrill jerrym@tech-tools.com http://www.tech-tools.com FAX: (972) 494-5814 VOICE:(972) 272-9392 TechTools PO Box 462101 Garland, TX 75046-2101 Join our PIC discussion list at http://www.tech-tools.com/picsource.htm -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics