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.

Help to write an assembly programing with PIC16f887 micro to transfer data thru USART

Status
Not open for further replies.

ashuanu2007

Newbie level 3
Joined
Feb 24, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Los Angels
Activity points
29
We are using a PIC16F887 board to execute it.


In this project we want to establish a simple asynchronous channel for communication in assembly language. Initially we need to initialize the device for this purpose in which we specify the mode of operation, baud rate, etc. We need a module to handle reading from the receiver side and the third module will be for writing to transmitter side. Using 8 bits for data and baud rate of 19200 for this purpose. In this project we simply receive a character from the hyper-terminal and send it back to hyper-terminal to display it again. So, for every character typed on hyper-terminal two of the same character must be displayed on hyper-terminal. You should configure the hyper terminal for this mode of operation as well.
 

It is not clear whether you want to do it entirely in sofeware or use the USART module that chip has.

One thing to consider with the posted code is that it lacks checks for overrun error (OERR) and framing errors (FERR). How to check for and clear those errors is explained i the 16F887 datasheet.

In addition, consider this line to clear RCIF:
Code:
BCF PIR1,5
RCIF (PIR1,5) is read only and cannot be cleared that way. The only way to clear it is to read RCREG. Given those two concerns, you might be better off attempting to write your own code and then coming back here for help on this assignment.

John
 

One way to do this is to write the code in C using a well supported tool - my suggestion being mikro - then
take a look at the assembler code it generates.
 

I am using MikroC software to dump the program into the Board and execute it using the assembly language. But the programs given above by Mr. Raj , its not been able to execute it. So, please help me out.

Thank you.
 

If you already have MikroC I'm confused as to why you would ignore the widely used and reliable
code provided to spend time with the code above you say doesnt work.
Perhaps I dont have a complete picture of what you are trying to do.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top