Can you tell us what you are sending and the result?
Also, how is your hardware set up?
Can you tell us what you are sending and the result?
Also, how is your hardware set up?
Dave
Always wear safety glasses while programming.
hi mackrackit,
three PICs are attached to a master PIC all of type 16F877A using RS-485.Also, how is your hardware set up?
configuration without leds lcd definitions :
* MASTER PIC:
Include "Modedefs.bas"
DEFINE OSC 4
DE_OR_RE VAR PORTC.5
RS232_DEBUG_PIN VAR PORTB.5
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_SPBRG 25
DEFINE HSER_BAUD 2400
DEFINE HSER_CLROERR 1
OPTION_REG.7 = 0
CMCON = 7
ADCON1 = 7
B0 = 0
SLave PIC:
Include "Modedefs.bas"
DE_OR_RE VAR PORTC.5
DEFINE HSER_RCSTA 90h
define HSER_TXSTA 20h
define HSER_SPBRG 25 'SPBRG 2400
DEFINE HSER_BAUD 2400
DEFINE HSER_CLROERR 1
DEFINE OSC 4 ' We're using a 4 MHz oscillator
DEFINE ADC_BITS 8 ' Set A/D for 8-bit operation
DEFINE ADC_CLOCK 1 ' Set A/D clock Fosc/8
DEFINE ADC_SAMPLEUS 50 ' Set A/D sampling time @ 50 uS
TRISA = %11111111
PORTA = %00000000
OPTION_REG.7 = 0
CMCON = 7
ADCON1 = 0
i'm sending from another PIC 1's and 0's which represent the status of my sensors it's attached on analog pins(four sensors for each slave PIC).Can you tell us what you are sending and the result?
The result should be also received as 1's and 0's as sent in sequence.
thanks for help...
485 ....
Have you enabled/disabled the TX pin?
If you are not familiar with 485 this is a good read
http://www.bb-elec.com/tech_articles...f_contents.asp
And buried in this thread is some code.
http://list.picbasic.com/forum/messa...html?996705165
Post your whole code so we can take a look.
Dave
Always wear safety glasses while programming.
hi mackrackit,
sorry for being late but i had some wrok to do the previous days..
here're the full code attached down, so it'll be easier to detect the errors.
yea, i'm already receiving and sending but my problem is the incorrect received values.Have you enabled/disabled the TX pin?
thanks alot...
Bookmarks