RS-485 test program

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
igeorge
Posts: 593
Joined: 28 Dec 2005 09:15

RS-485 test program

#1 Post by igeorge » 08 Apr 2013 09:47

This is a test program between two boards and RS-485 link
Tested at 115200 bauds on two easypic7 with two ME rs485 boards and 4X20 LCD, PIC18F4620 , 8 MHz internal with clock output on PortA
Can send receieve up to 32 bytes in one transmission
This is half mode protocol. Master send data and receive reply
To test, i just added 1 to data received end send it back. At 255, will roll over
50 ms delay between transmissions of master to see numbers better on LCD. Slave reply instantly without delay
It works on master down to instant reply without delay
If you do changes, MUST CYCLE POWER OF THE BOARD BEFORE START !!!
I do not know why it crash just after programing without cycle power, but for me it is OK
Put power on both boards, and press PortE.0 button on Master board for start and PortE.2 for stop.
When started, PortE.1 on master turn ON, and OFF when you stop.
The ID for Master is 1 and for slave is 2
Can be changed by user reprograming - explanation on comments.
Enjoy
Attachments
RS-485-N_ BYTES_ ECHO.rar
(195.72 KiB) Downloaded 151 times
Last edited by igeorge on 30 Apr 2013 09:09, edited 1 time in total.
Experience is something you don't get until just after you need it

User avatar
filip
MIKROE team
Posts: 11859
Joined: 25 Jan 2008 09:56

Re: RS-485 test program

#2 Post by filip » 30 Apr 2013 08:22

Hi,

Thank you for your contribution, could you upload this also on the LibStock ?

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for PIC General”