Re: Has my PIC blown?
- From: "Anthony Fremont" <spam@xxxxxxxxxxxx>
- Date: Fri, 18 Nov 2005 20:54:39 GMT
"Silverfox" <silverfox.williams@xxxxxxxxx> wrote
> 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.
I don't know of any significant differences. The "A" model probably
programs faster.
The 16F84(A) chips are considered obsolete now. There are cheaper, more
capable parts now that you may like better. The 16F88 has built in ADC
and an 8MHz internal oscillator that's usably accurate.
> 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.
Sounds like a ceramic resonator then. The caps are built in on the 3
pin models, so you should be fine. A resonator is probably accurate to
about .5%. A regular crystal might be accurate to .005%. The resonator
is more than accurate enough for serial communications.
> I am powering my PIC through a 7805C voltage regulator, which is
> powered by a DC power supply.
That should work fine. Be sure to use capacitors on the input and
output of the regulator. Also be sure to feed the regulator at least 7V
for headroom.
> I am currently fixing the MCLR and other things and also reading this
> data*** too, I will let you know how I get on.
Keep us informed as to your progress.
> I really hope I don't insult any of you with these questions and my
> niaveity of this new subject to me.
If anyone was insulted by those questions, it certainly wouldn't be your
fault.
BTW, what kind of programmer are you using to flash the PIC?
> 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.
You should probably go ahead and clear PORTA and PORTB as well.
> BSF PORTA, BIT0
>
> END ; End must appear on the last line of the program
> ; so the assembler knows where to stop.
.
- Follow-Ups:
- Re: Has my PIC blown?
- From: Silverfox
- Re: Has my PIC blown?
- References:
- Has my PIC blown?
- From: Silverfox
- Re: Has my PIC blown?
- From: Anthony Fremont
- Re: Has my PIC blown?
- From: Silverfox
- Has my PIC blown?
- Prev by Date: Re: 555 Problem - New
- Next by Date: Re: PID Loop basics info???
- Previous by thread: Re: Has my PIC blown?
- Next by thread: Re: Has my PIC blown?
- Index(es):