Hi forum. I'm new ( in this forum and at microcontrollers ).
I'm having trouble trying to do my first project: let a led lights up
I'm using MPLab IDE 8.46 to program and simulate and IC-Prog 1.05D to program ( to the chip )
I'll put my source code and my schema, if someone help me i'll be greatful
And my protoboard schema:
http://img199.imageshack.us/i/lilod.png/
I'm using 4 1.5V batteries to gain ~4.6V as feeding.
well... that's it, i'm kinda furstrated because I am working on that the hole week, and I can't figure what's wrong
Please help ... I don't know what else can I do
I'm having trouble trying to do my first project: let a led lights up
I'm using MPLab IDE 8.46 to program and simulate and IC-Prog 1.05D to program ( to the chip )
I'll put my source code and my schema, if someone help me i'll be greatful
Rich (BB code):
; INCLUDE OBRIGATORIO
#INCLUDE <P16F628A.INC>
; CONFIGURACOES
__CONFIG _BOREN_ON&_CP_ON&_DATA_CP_OFF&_PWRTE_ON&_WDT_OFF&_LVP_OFF&_MCLRE_ON&_XT_OSC
; BANCOS DE MEMORIA
#DEFINE BANCO_0 BCF STATUS,RP0 ; BANCO DE MEMORIA 0
#DEFINE BANCO_1 BSF STATUS,RP0 ; BANCO DE MEMORIA 1
; CONSTANTES DE SAIDA
#DEFINE LED PORTA,0 ; LED
#DEFINE LED2 PORTB,0 ; LED
; RESET
ORG 0x00
GOTO INICIO
; INTERRUPCOES
ORG 0x04
RETFIE ; RETORNA AO PONTO INTERROMPIDO
INICIO
BANCO_1
MOVLW B'00000000'
MOVWF TRISA ; SETA PORTA COMO OUTPUT
MOVWF TRISB ; SETA PORTB COMO OUTPUT
MOVLW B'10000000'
MOVWF OPTION_REG
MOVLW B'00000000'
MOVWF INTCON
BANCO_0
MOVLW B'00000111'
MOVWF CMCON ; CONFIGURA RA3:RA0 COMO I/O
CLRF PORTA
CLRF PORTB
MAIN
BSF LED ; ACENDE O LED
BSF LED2 ; ACENDE O LED
GOTO MAIN
END
http://img199.imageshack.us/i/lilod.png/
I'm using 4 1.5V batteries to gain ~4.6V as feeding.
well... that's it, i'm kinda furstrated because I am working on that the hole week, and I can't figure what's wrong
Please help ... I don't know what else can I do