> Can I just check- is there a known problem with the source code given on > page 43 of the 16F877 datasheet? I ask because I cannot get it to work, > either using the simulator or using an uC. The problem lies around the SLEEP > command. When I run through the code, the SLEEP command steps okay but the > next command hangs regardless of what it is. > In desperation I looked at the EPE datalogger source code and note that > although they have used the exact code as stated in the datasheet they have > replaced the "SLEEP" command with a manual check for the EEIF flag. > Is this a known gottcha? > Thanks > > Ben Hi ben: Are you sure you enabled the EEIE interrupt ??? The SLEEP command will put the CPU in a low power mode, and you will need an interrupt (or reset) to restart the program ... If your program is hanging after the SLEEP instruction, thats because the CPU is actually "sleeping", and one will need to generate an interrupt (like the end of writing the EEPROM - EEIF). Maybe this helps .... Fabio Pereira -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads