Hi MINHLE,
try this
Code:
ADCON0 = 0
ADCON1 = 7
A VAR BYTE
PORTB = 0 ; SET PORTB AS OUTPUT
PORTC = 0 ; set port c as output
trisB = %00000000 'all ports B as outputs
TrisC = %00000000 'all ports C as outputs
PORTC.1 = 0 ; set port C1 to low wich enables leds ground pin
CCP1CON = 0 ' turn off CCP Module which affects portC
pause 300
LOOP:
FOR A = 0 TO 8 'loop to repeat
PORTB.0 = 1 'set port B0 to high, turn on led
PAUSE 500
PORTB.0 = 0 ; set port B0 to low, turn off led
PAUSE 300
NEXT A
GOTO LOOP ' Flash forever
END
The only difference is I set Tris registers and disabled Capture Compare Module. and turned off A/D converter. Now how have you set your config fuses? You have specified 20 mhz and this will not work with the default config statement found in the C:\PBP\16f877.inc file.
Last edited by Archangel; - 5th February 2009 at 03:17.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks