Re: Has my PIC blown?
- From: "Silverfox" <silverfox.williams@xxxxxxxxx>
- Date: 18 Nov 2005 08:27:57 -0800
Well firstly thank you all for your great help :-) I don't know which
to reply to.
Well I was reading wrong data *** to start ooops, I was reading
PIC16F84A, but I think they are similar, but different.
The oscillator I am using does have 3 pins, middle is grounded, sorry I
don't know how I can tell if its crystal or not, its like a yellow blob
on three pins. I am sorry, I am new and I am trying to learn too.
I am powering my PIC through a 7805C voltage regulator, which is
powered by a DC power supply.
I am currently fixing the MCLR and other things and also reading this
data*** too, I will let you know how I get on.
I really hope I don't insult any of you with these questions and my
niaveity of this new subject to me.
Oh and my code is:
;*******************************************************************
; START.ASM
; Testing how to program a PIC
;*******************************************************************
LIST p=16F84 ; PIC16F84 is the target processor
#include "P16F84.INC" ; Include header file
;************************************
; General Equates
;************************************
; These are included in the "P16F84.inc" file
BIT0 EQU 0
BIT1 EQU 1
BIT2 EQU 2
BIT3 EQU 3
BIT4 EQU 4
BIT5 EQU 5
BIT6 EQU 6
BIT7 EQU 7
;************************************
; I/O Equates
;************************************
; These are included in the "P16F84.inc" file
;************************************
; Memory Equates
;************************************
;************************************
; Macros
;************************************
BANK0_MACRO macro ; this defines the BANK0_MACRO macro.
BCF STATUS, RP0
endm ; this is the end of the macro Bank0.
BANK1_MACRO macro ; this defines the BANK1_MACRO macro.
BSF STATUS, RP0
endm ; this is the end of the macro Bank1.
;****************************************************
; Start and Interupt Addresses
;****************************************************
ORG 0H ; Change address depending on pic type,
; see reset vector section.
GOTO INIT ; This is where you want the program to start.
;****************************************************
; Subroutines Start here.
;****************************************************
INIT ; The program starts here
CLRW ; Clears the W register.
; We are using bank 1 to modify TRISA which will tell PORTA to be
outputs.
BANK1_MACRO ; This will set bit 5 of the STATUS register
; to say to use bank 1.
MOVLW B'00000000' ; This will set all the bits of W to 0.
MOVWF TRISA ; This will move the contents of W to TRISA
; Hence, setting up PortA as outputs.
MOVWF TRISB ; This will move the contents of W to TRISB
; Hence, setting up PortB as outputs.
BANK0_MACRO ; This will set bit 5 of the STATUS register
; to say to use bank 0.
BSF PORTA, BIT0
END ; End must appear on the last line of the program
; so the assembler knows where to stop.
Thanx again for your help
Richard
.
- Follow-Ups:
- Re: Has my PIC blown?
- From: Anthony Fremont
- Re: Has my PIC blown?
- From: Tim Duke
- Re: Has my PIC blown?
- References:
- Has my PIC blown?
- From: Silverfox
- Re: Has my PIC blown?
- From: Anthony Fremont
- Has my PIC blown?
- Prev by Date: Re: SET tube amp and blowout?
- Next by Date: Re: Has my PIC blown?
- Previous by thread: Re: Has my PIC blown?
- Next by thread: Re: Has my PIC blown?
- Index(es):