>-----Original Message----- >From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]=20 >Sent: 01 September 2005 17:08 >To: 'Microcontroller discussion list - Public.' >Subject: [PIC] Pic16f84a vs pic16f628 > > >Hi all, > >At time I have no way to solve a little problem using a=20 >pic16f628. The original program was working well in a=20 >pic16f84a, but when I change the headers and compile it for a=20 >pic16f628 never works. > >The program is simple, at start time; it turns on 3 leds one=20 >by one with a delay of 20 mS between each one, so after 60mS=20 >the 3 leds must be ON. > > +--------------------------------------- >LED1 ---! +---------------------------------- >LED2 --------! *---------------------------- >LED2 --------------! > >After 1 second, the sequence must be to turn OFF each led with=20 >a delay of 10 mS between each on. > >With a PIC16F84A it works well but when I use a pic16f628, the=20 >leds never be turned to ON in sequence. > > +----* >LED1 ---! !---------------------------------- > +-----+=20 >LED2 --------! !---------------------------- > +----+ >LED2 --------------! !----------------------- > >Question is: What=B4s wrong? Almost certainly you have forgotten to disable the comparator, so the ana= log pins always read back zero. This means if you perform a bsf on the p= ort, all the other pins will get set to zero. Regards Mike =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist