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.?
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.
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