Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

help with pic16f84a

Status
Not open for further replies.

freesprited

New Member
are there any compilers that you can download and use for PIC16F84A.
it is one of my subjects at uni and i needed a hand with it.

when stetting up the ports, if we want porta set up as inputs and port b as upper 4 bits as inputs and lower 4 bits as outputs.........
why is it set up in the following manner?


f equ 1
w equ 0
porta equ 5
trisa equ 85
porta equ 6
trisa equ 86
 
freesprited said:
are there any compilers that you can download and use for PIC16F84A.
it is one of my subjects at uni and i needed a hand with it.

when stetting up the ports, if we want porta set up as inputs and port b as upper 4 bits as inputs and lower 4 bits as outputs.........
why is it set up in the following manner?


f equ 1
w equ 0
porta equ 5
trisa equ 85
porta equ 6
trisa equ 86
This is just header part of the program, it just says Asebler where (in memory) to look for eg. porta...
The program should look like this:
Code:
	org	0x0005
INIT	CLRF	PORTA
	CLRF	PORTB
	BSF	STATUS,RP0
	MOVLW	b'00001111'	;direction Port A
	MOVWF	TRISA
	MOVLW	b'00000000'	;direction Port B
	MOVWF	TRISB
	BCF	STATUS,RP0
	MOVLW     b'01010000'
           MOVWF     PORTA
 
freesprited said:
are there any compilers that you can download and use for PIC16F84A.
it is one of my subjects at uni and i needed a hand with it.

when stetting up the ports, if we want porta set up as inputs and port b as upper 4 bits as inputs and lower 4 bits as outputs.........
why is it set up in the following manner?


f equ 1
w equ 0
porta equ 5
trisa equ 85
porta equ 6
trisa equ 86

These are the standard MicroChip equates, you don't need to input them - simply 'include' the file that MicroChip supply as part of the assembler, that way you are guaranteed to get the correct ones.

Have a look at my tutorials for details!.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top