Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

NEED HELP 12C509 TO 16F84

Status
Not open for further replies.

Fragrance

Advanced Member level 4
Advanced Member level 4
Joined
Jul 26, 2002
Messages
1,190
Helped
248
Reputation
496
Reaction score
202
Trophy points
1,343
Location
East Of Earth
Activity points
8,933
Hi all,

I am sending a source code written for pic 12c509 chould any body help me how i can convert this for pic 16f84 chip because this chip is hard to find in country

regards

khalid :(
 

Greets, I have looked at your code, and although it is pretty straightforward to convert to a 1684, it will be time consuming. May I suggest that in future you make your code a little easier to understand, and easier to port. For example, this is your delay routine. It uses three variables 7, 8, 9, and one constant, 0x05. 7, 8, and 9 are not available on a 1684, so you have to change 6 values. Time consuming and error prone.

; * * * subroutine * * *

delay clrf 7
clrf 8
movlw 0x05 ; one second
movwf 9
dly decfsz 7
goto dly
decfsz 8
goto dly
decfsz 9
goto dly
retlw 0

Better is to use named variables:

;------ Delay variables

count1 equ 7
count2 equ 8
count3 equ 9

;------ Constant

time equ 0x05 ;one second delay

;------ Delay subroutine

delay clrf count1
clrf count2
movlw time
movwf count3
dly decfsz count1
goto dly
decfsz count2
goto dly
decfsz count3
goto dly
retlw 0

now, to change to a 1684, just change the equates to available ram.

Also with your i/o lines,

bcf 6,4 ; go on hook

pretty obscure? Better is to use named constant:

;------ i/o lines

hook equ 4

;------ code

bcf GPIO,hook

now, for a 1684, just change GPIO to Port_A, or whatever and update the equate.
Hope this is some help.
 

Hello, KHALID BHATTI

I'd like to suggest you onething possibility to use 16F84.
Fourtunately, Hi@tech support free C-compiler for this device.
If you are familiar with embeded C programming, I'd like to suggest
you try it. You'll be somewhat free from some difficulties which are sticky
to hardware and easy to move device to device.

Good luck.
:roll:
 

btbass

Thanks friend btbass
It's nice idea i work on it if i feel any defficulty then i ask you again for kind guidance

regards
khalid
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top