On Wed, 16 August 2000, Greg Maki wrote: > > Jeff Scharpf wrote: > > > > I was hoping someone could just take a quick look at a small snippet of code I have and tell me if there is anything obviously wrong. What I'm doing is setting up a 16F876 with porta as input, portb as input, and portc as outputs. I have all inputs for porta and portb tied to V+. I have the portc outputs going to LEDs. All I wanted to do was run timer0 internally, use the timer0 interrupt to go out and increment a register, then display this on the portc outputs to show that the interrupt is working. I used a 256 scaler so it didn't go so fast. I know that i have some defined variables that I have not used yet.I am very new at this :( Any help is greatly appreciated. > > I did read the beginners help page and was able to run simple code that read an input from port a and incremented a register, then sent it to portc leds. This worked, so I believe electricallly everything is ok. > > > > Thanks, > > > > Jeff Scharpf > > > > Jeffrey Scharpf > > Senior Engineering Technician > > Milwaukee Electric Tool Corporation > > Technical Center > > Brookfield, Wisconsin, 53005 > > (262) 783-8681 > > _______________________________________________________ > > Are you a Techie? Get Your Free Tech Email Address Now! > > Many to choose from! Visit http://www.TechEmail.com > > > > ------------------------------------------------------------------------ > > Name: freq.asm > > freq.asm Type: Plain Text (text/plain) > > Encoding: 7bit > > snip > > > start bsf status,rp0 ;set rp0 to set bank1 > > movlw 0xff ;set porta to inputs > > movwf trisa > > movlw 0xff ;set portb to inputs > > movwf trisb > > movlw 0x00 ;set portc to outputs > > movwf trisc > > clrf portb ;set all lines on b low > > clrf portc ;set all lines on c low > > bsf optreg,RBPU ;release port b internal pullups > > bcf optreg,INTEDG ;set interrup to occur on falling edge > > bcf optreg,T0CS ;set tmr0 to perform as timer (internal) > > Jeff, > > The only thing I see wrong is that your 'clrf portb' and 'clrf portc' > are actually clearing the trisb and trisc registers since the RP0 bit is > still set. I hope you have those port pins tied to V+ with some > resistors! > > Try putting the 'bcf STATUS,RP0' command after the 'movwf trisb' > command. It should work a lot better. And you might want to #include > instead of having to define all of those registers > yourself. > > Hope this helps, > > Greg Maki > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. Thanks greg that fixed it. Now I have what appears to be an MLAB problem ! :( Jeff Jeffrey Scharpf Senior Engineering Technician Milwaukee Electric Tool Corporation Technical Center Brookfield, Wisconsin, 53005 (262) 783-8681 _______________________________________________________ Are you a Techie? Get Your Free Tech Email Address Now! Many to choose from! Visit http://www.TechEmail.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu