Hmm, that's odd, but I'll remember that... I fixed it by the suggestions I got before w/the shadow register but I saved my previous code and will give that quick-fix a try. nick@veys.com | www.veys.com/nick >Nick, > >I just plugged this into the sim, and got the same >problem with only RA5 blinking. However, I added >these 2 code lines and it worked properly... > > movlw B'00000110' > movwf ADCON1 ; Port A all digital > >Cheers, >-Neil. > > > >-----Original Message----- >From: pic microcontroller discussion list >[mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Nick Veys >Sent: Monday, June 24, 2002 8:05 PM >To: PICLIST@MITVMA.MIT.EDU >Subject: [PIC]: PORTA output troubles! > > >Ok I'm guessing this is a painfully obvious, 5 second fix, but >it's had me stumped for 2 evenings. > >I have the following code: > >--------snip------------------------------------------------- > >TRISA = 0b00000000; > >while(1) >{ > RA2 = RA3 = RA4 = RA5 = 0; > DELAY_MS(250); > RA2 = RA3 = RA4 = RA5 = 1; > DELAY_MS(250); >} > >--------snip-------------------------------------------------- > >Which should simply blink the LEDs I have hooked up to >PORTA[5:2]. No luck. With the above code, RA2 will blink, >the rest do nothing. If I change the order, say from RA5 = >RA4 = ... = 0; and the same for the = 1; part, RA5 will blink, >and the rest do nothing. So it appears the 1st one in the >list works. Odd. Now if I take that line apart into: > >RA2 = 0; >RA3 = 0; > >... > >etc, same thing happens, RA2 blinks, the rest do nothing. > >I thought maybe it was a speed thing, so I put NOPs between, >nothing happens, and I doubt that would do anything because, >well, I've never experienced anything like that before. > >So I tried to do it in assembly, this project is basically a >HiTech PICC test anyways... > >So I have this: > >------snip----------------------------------------- > >MAIN > _BANK 1 > movlw b'00000000' > movwf TRISA > _BANK 0 > >loopage > bsf PORTA,2 > bsf PORTA,3 > bsf PORTA,4 > bsf PORTA,5 > DELAY_MILLI 250 > bcf PORTA,2 > bcf PORTA,3 > bcf PORTA,4 > bcf PORTA,5 > DELAY_MILLI 250 > goto loopage > > end > >------snip--------------------------------------- > >But here, I get just !!!!!RA5!!!!! blinking. I'm thoroughly confused. > >Ideas? Please tell me I'm dumb and need to set a bit somewhere! :) > >Gracias in advance. > >nick@veys.com | www.veys.com/nick > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply >us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > >-- >http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu