Pessoal aqui é um programa que comunica o pic com o canal serial;envia texto " Hello,world '' talves se implementar consiguimos comunicar o PIC com o LCD 16x2.
#################################################
LDmicro export text
for 'Microchip PIC16F628 18-PDIP or 18-SOIC', 4.000000 MHz crystal, 10.0 ms cycle time
LADDER DIAGRAM:
|| ||
|| ; Very simple, just print 'Hello, world' over serial, over and over. ||
1 || ||
|| ||
|| ||
|| ||
|| ||
|| Rosc Tosc Rosc ||
2 ||-------] [---------[TON 1.000 s]-------------------------------------------(/)-------||
|| ||
|| ||
|| ||
|| ||
|| ; For no particular reason, keep a counter that increments with each ||
3 || ; line that we print. ||
|| ||
|| ||
|| ||
|| ||
|| Rosc _ {ADD cnt :=} ||
4 ||-------] [-----------[OSR_/ ]--------------------------------{ cnt + 1 }----------||
|| ||
|| ||
|| ||
|| ||
|| Rosc cnt ||
5 ||-------] [-----------{"Hello, world: \-5\r\n"}----- ||
|| ||
|| ||
|| ||
||------[END]--------------------------------------------------------------------------||
|| ||
|| ||
I/O ASSIGNMENT:
Name | Type | Pin
----------------------------+--------------------+------
cnt | UART tx | 8
Rosc | int. relay |
Tosc | turn-on delay |