I'm experiencing problems with a project the goal is to receive a time information string from 1
processor to the other.
setup:
16F628:
using the onboard crystal (4mhz)
DCF time decoder; code used for sending the data string to the other processor:
18F452:Code:DEFINE HSER_TXSTA 20h ' Set baud rate DEFINE HSER_BAUD 19200 HSerout ["A", STR TimeDate\6]
10MHZ crystal; osc settings PLL X 4 runs on 40mhz
Code used to receive:
Code:DEFINE OSC 40 intcon = %11000000 ' enable global and Peripheral interrupt pie1.5 = 1 ' enable interrupt on usart receive pir1.5 = 0 ' clearing interrupt flags adcon1 = %00001110 ' setting all pin's to digital i/o pins DEFINE HSER_RCSTA 90h DEFINE HSER_BAUD 19200 DEFINE HSER_CLROERR 1 ' automatically clear error's on overflow ON INTERRUPT GoTo handle Disable ' interrupt handler Handle: HSerin 500,TimeOut,[WAIT("A"),STR TimeDate\6] DCFSignal = 1 TimeDate(5) = TimeDate(5) + 1 GoTo Perfect TimeOut: GoSub SecondLineLCD LCDOut "DCF Error" DCFSignal = 0 Perfect: pir1.5 = 0 ' clearing interrupt flags pir1.3 = 0 ' clearing interrupt flags Resume Enable
I think the receiving issue is a sync problem because if I run the processor @ 20mhz and set the
define osc to 20 then it works fine. what am I doing wrong?
I'm also experiencing problems with the read and write commands for the onboard eeprom it give's
compiler error's; it doesn't give errors when I compile a program for a 16f877 using the old
compiler; the new compiler does give error's I'm using the MPASM V03.70.




Bookmarks