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.

Serial communication with PIC16F84

Status
Not open for further replies.

johnny_hush

Member level 1
Joined
Jan 19, 2007
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,475
I'm using 16f84, and I need to program it, so when it receives some data, for example 8bits (with UART standard) it checks if received data matches to other data previously stored in eeprom, and if it is a match case it will go to one label, and if it isn't that it will go to other label.

It would be a great help if someone could post code, so I can see how I'm suppose to do that. [I work only in assembler]

Thanks,

Johnny
 

donkey41

Full Member level 1
Joined
Feb 19, 2002
Messages
99
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
Pakistan
Activity points
949
Code:
; suppose, you have a variable "uart_data" where you store the incomming data
; and you have another variable "ee_data" in which you load being checkd data 
; from EEPROM - I assume that you know, how to read data from internal EEPROM
; Z is status bit in STATUS register which shows the result of last 
; arithmatic or logical oparation.

        movf        ee_data,0              ; move the contents of ee_data to w
        andwf       uart_data,0            ; try to AND ee_data with uart_data
        btfsc       Z                      ; now check, what was the result of AND oparation
        goto        label_1                ; NOT IDENTICAL, goto lable_1   Z = 1
        goto        label_2                ; IDENTICAL, goto label_2 		Z = 0
 

johnny_hush

Member level 1
Joined
Jan 19, 2007
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,475
Thanks!

Do you have something about receiving serial data?
 

Kabanga

Member level 4
Joined
Oct 4, 2007
Messages
76
Helped
7
Reputation
14
Reaction score
1
Trophy points
1,288
Activity points
1,720
Hello !!!
serial communications with the PIC16F84 is possible only per software!!! Means, you dedicate some pins to the serial communication and then you write the code. It's long and tough, if you never did it!!

I'd advise you to use a PIC with embedded USART like the PIC16F877. You'd just make some initializations (few lines of assembly code) and your PIC is fully ready for serial communitions.

Regards
 

blueroomelectronics

Advanced Member level 5
Joined
Sep 17, 2006
Messages
1,686
Helped
180
Reputation
358
Reaction score
77
Trophy points
1,328
Location
Toronto, Canada
Activity points
8,696
Kabanga said:
Hello !!!
serial communications with the PIC16F84 is possible only per software!!! Means, you dedicate some pins to the serial communication and then you write the code. It's long and tough, if you never did it!!

I'd advise you to use a PIC with embedded USART like the PIC16F877. You'd just make some initializations (few lines of assembly code) and your PIC is fully ready for serial communitions.

Regards

Agreed, you can use a 16F628A which is a modern version of the 16F84
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top