Problems using 16f84A code on 16f628
I have started to work on a basic telemetry project to control radio repeaters. I have got it working fine on a 16f84A, and for several reasons have decided to switch to using a 16f628. When the pic sends its initial string it appears to be way to fast. My thoughts were that p16pro would make any changes required when I select the correct micro. If someone has any ideas I would appreciate them. Thanks in advannce.
INCLUDE "modedefs.bas" ' Include serial modes
DEFINE OSC 4
DEFINE DEBUG_REG PORTA
DEFINE DEBUG_BIT 3
DEFINE DEBUG_BAUD 1200
DEFINE DEBUG_MODE 0
DEFINE DEBUGIN_REG PORTA
DEFINE DEBUGIN_BIT 2
DEFINE DEBUG_BAUD 1200
DEFINE DEBUG_MODE 0
outstate VAR BYTE
B0 VAR BYTE
b1 VAR BYTE
b2 VAR BYTE
b3 VAR BYTE
id VAR BYTE
id=01
High PORTB.3
Debug "repeater controler v0.1",13
High PORTB.2
loop:
DebugIn [wait("rep"),b0,b1,b2]
IF b2 ="f" Then outstateoff
IF b2 = "n" Then outstateon
Button PORTB.2,0,0,0,b3,1,testout
GoTo loop ' Forever
outstateoff:
Low PORTB.5
High PORTB.4 'Tx on
High PORTB.3 ' ctcss enc on
Pause 1000 'lead in delay or LET
Debug 13," repeater ",b0," is OFF ",13
Pause 300 'lead out delay
Low PORTB.3 'turn off ctcss
Pause 300 ' wait to give quiet dekey
Low PORTB.4 ' turn off TX
GoTo loop
outstateon:
High PORTB.5
High PORTB.4 'Tx on
High PORTB.3 ' ctcss enc on
Pause 1000 'lead in delay or LET
Debug 13," repeater ",b0," is ON ",13
Pause 300 'lead out delay
Low PORTB.3 'turn off ctcss
Pause 300 ' wait to give quiet dekey
Low PORTB.4 ' turn off TX
GoTo loop
testout:
Debug 13,"abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ",13
GoTo LOOP