Hello.
Having a strange issue.
PIC18F45K80 and PIC16F1936.
they are connected to each other via 22K resistor. PORTC.3 on both.
Trying to run the simple code:
TX: (1936)
Code:
barka:
serout2 portc.3,84,[345]
pause 100
goto barka
RX (45K80)
Code:
taka:
serin2 portc.3,84,[x]
if x=345 then stop
lcdout $fe, $c0, "X=", dec x, " "
goto taka
It does not work, it never receives "345". received value is always random, but quite often it is 89.
Variable types are proper, port configs also.
I tried to change direction and send from 18F to 16F - same issue.
Checked signals with scope - no issues.
Tried to various resistors - 1K, 10K, 22K - no difference.
Yes I know that hardware port should be used, but PCB is already made.
Distance from one chip to another is about 10 centimeters and they're both on the same PCB and same power supply. I've checked signals with scope and there are no issues, like low levels or noise.
I tried to make code more complicated, like sending 8 characters + control character (enter) -this improves it a bit, might say that at least one try from 10 delivers proper result. Sometimes, it starts to work fine, but then again messes up. Also tried reducing port speed to 1200bps - no change.
Any ideas?
Bookmarks