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.

programming for PIC 16F877a

Status
Not open for further replies.

Rooney_04

Member level 2
Joined
Oct 2, 2010
Messages
47
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,604
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.?
 

ansarmytheen

Full Member level 3
Joined
Jan 9, 2010
Messages
155
Helped
55
Reputation
110
Reaction score
53
Trophy points
1,308
Location
kerala
Activity points
2,100
Dear friend,

It is easy one, here we use basic serial communication method.Here i attach a simple program for transmitting any data(digital numbers/characters)
 

Attachments

  • serialtr.txt
    165 bytes · Views: 25

incomplete_jerin

Advanced Member level 2
Joined
Jun 4, 2010
Messages
551
Helped
97
Reputation
208
Reaction score
93
Trophy points
1,308
Location
INDIA
Activity points
3,912
For the above purpose there is a USART(Universally Synchronous Asynchronous Receiver Transmitter) Module in the controller. Do refer the data sheet for the module details & it is explained there how to configure it too(the module).
(Refer the data sheet of PIC 16F87XA page no:111).
Regards,
Jerin. ;-)
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,792
Reputation
3,576
Reaction score
1,651
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,543
Hi,
For this purpose you have to use USART or UART module. This is present in 16F877A. Like Jerin said, check the datasheet and also check the Microchip Mid Range Microcontroller Reference Manual where all details of UART/USART are explained in detail. You also did not mention which language you use. Your compiler may have inbuilt functions for UART.
Code in mikroBASIC:
Code:
program UART
dim uart_rd as byte
dim chart as byte

main:
  UART1_Init(9600)                         ' Initialize UART module at 9600 bps
  Delay_ms(100)                            ' Wait for UART module to stabilize
  chart = 'A'                                  ' Any value to send
  UART1_Write(chart)                     '   and send data via UART
  while true
  wend
end.

I hope you know the hardware connection and how to use MAX232 for your purpose.

Hope this helps.
Tahmid.
 

fyp0711

Newbie level 2
Joined
Feb 3, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,289
Hello guys,
I also want to send the data from pic16f877a to pc through rs232 but what will be the code in PicC compiler please help me in this please i will be very thankful to you all.
Regards
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top