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.

programming for PIC 16F877a

Status
Not open for further replies.

Rooney_04

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

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: 73

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. ;-)
 
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.
 

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

Back
Top