programming for PIC 16F877a

Status
Not open for further replies.

Rooney_04

New Member
hi....
i need to send few digital data through pic16f877a . Doesn't matter the digital data is a 4 bit or 8 bit. The basic concept i use pic16f7887a as my transmitter to transmitter digital. So for example i would send 00001100 and transmit through rs232 communication. How should i do that ? how would be the programming code.?
 
Here is the Microchip information and documents for that chip...
PIC16F877

I would read the data sheet, especially the configuration bits section and the USART section.

Then on the same page above under Reference Manual is one called ""USART - PICmicro Mid-Range MCU Family". I would read that and also download any source code if provided.

Then if programming in C, I would poke around in the include directory of the compiler I am using and look for anything called USART.h or related. Then look through that. And search the compiler documents to see if there was any information about the USART.

I found the above treasure trove of infromation by going to www.microchip.com, then searching for 16f877a, then found not much of anything, so then I removed the "a" and searched for 16f877, then found the above.
 

hi,
Look at Nigel's tutorial link, its near my signature on this post....
 
but i m using CSS C compiler ...how i can do that?
Obviously as you are not using assembler you cannot.
You should have stated the programming language that you are using.

I do not work in 'C' but other members do, so I am sure someone will help out.
 
Hi, look at this page. It lists examples in which Serial communication has been carried out. The "Simple A/D" example shows you how to send data and how to receive data.

CCS, Inc. - CCS C Compiler Example Programs

Its pretty simple since sending data is accomplished by using the printf function. The USART is configured by the

#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)

line.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…