Instead of starting a new thread , I thought of just adding my problems story to this one.
I am have a network of RS485 using 16F676 IC. I am having a big problem with communicating with the PC.
My harware config is :
Pin#1 of RS485 ----> MCLR/RA3
Pin#2&3 of RS485 --> RA4
Pin#4 of RS485 ---> RA5
My code is as follows:
@ DEVICE PIC16F676,INTRC_OSC_NOCLKOUT,WDT_ON,PWRT_OFF,BOD_O N,PROTECT_OFF,CPD_OFF,MCLR_OFF
Include "Modedefs.Bas"
ANSEL = 0 ' DISABLE THE ANALOG INPUT
CMCON = 7 ' DISABLE COMPARATOR ON PORTA
VRCON = 0 ' A/D Voltage reference disabled
TRISA = %00101000 ' SETS ALL PORTA PINS TO INPUT ' Set PORTAA to all input
TRISC = %00000000 ' 6 Pins - LCD and 2 Pins RF Module
LED VAR PORTC.5 ' LED (SINK)
SER_IN VAR PORTA.3 ' DATA INPUT PORT
DO VAR PORTA.5 ' DATA OUTPUT PORT
RS485 VAR PORTA.4 ' RS485 CONTROL PIN
HIGH RS485 :
' ----------------------------------------------------------------------
' ** Declare the Variables **
I VAR WORD ' TEMP VARIABLE
' ----------------------------------------------------------------------
HIGH RS485
LOOP:
FOR I = 16400 TO 16900 STEP 10
SEROUT2 DO,I,["VALUE: ", DEC I,10,13] ' FOR RS232
PAUSE 500
NEXT
GOTO LOOP
END
I seem to have lost my OSCAL value and I am trying to get a reliable comm using Hyperterminal software over RS485.
I am getting no Output on the Hyperterminal @2400
Can anyone help.
regards
Bookmarks