PDA

View Full Version : testing pic16f877a



lerameur
- 5th October 2008, 02:53
hello

I am making a short program to test a pic16f877a. but I am getting 0v at the output.
anyone knows why?
it should show all pins at 5v

thanks
ken



' test pic
INCLUDE "modedefs.bas"
@ DEVICE PIC16F877a , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF
'HS 20mhz, watchdog off, powerup timer on, mclr external, brown out detect on, low volt program off , code protect off

DEFINE OSC 20 'use external 20mhz crystal

TRISA = %00000000 ' Set PORTA to all output
TRISB = %00000000
TRISC = %00000000
TRISD = %00000000
TRISE = %000

Pause 1000 ' Wait 1 second

Mainloop:

PORTA=1
PORTB=1
PORTC=1
PORTD=1
PORTE=1

Pause 5000 'pause
goto Mainloop

End

mackrackit
- 5th October 2008, 04:12
First off this will help
http://www.picbasic.co.uk/forum/showthread.php?t=561

Do any of the pins show 5 volt?

lerameur
- 5th October 2008, 04:15
hey,

none of the pins shows 5v :(
oo except for Vdd ..hehe

ken

lerameur
- 5th October 2008, 04:29
I found the problem,
I shifted the vdd nd vss pins, I could not see the hole next to the oscillator because of the big crystal. working now.

Ken

skimask
- 5th October 2008, 05:43
I shifted the vdd nd vss pins, I could not see the hole next to the oscillator because of the big crystal. working now.
I'd keep an eye on that particular PIC, maybe mark it somehow as 'possibly damaged' in case it quits working in the future.
I've put a few PICs in backwards here and there, over-volted them, 9v across a pin here and there. They always seem to work for awhile afterwards, a few have dead outputs on a few pins, nothing definitive, but you never know... Could come back to bite you in the rear end in the future...