Serial communication between PIC and Atmega controileer trough RS485


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Nov 2011
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Serial communication between PIC and Atmega controileer trough RS485

    Hello aratti,

    Yes i have the pulldown and the pullup resistors connect, not solve

    with this i receive on the display the data on the atmega88 controller that works as slave

    _start:

    If Ischarwaiting() <> 0 Then 'test if char arrive
    Inputbin Serialchar 'get it
    If Serialchar <> 254 Then Goto _start 'the first value must be 254
    Inputbin , T_destino , Crypt 'get the rest two values
    Clear Serialin
    End If


    the works as master, and send this binary data

    i try to send it as decimal as too hex
    serout2 disp_pos,396,[dec master,dec destino,dec posicao]
    and also
    pause 1000
    serout2 disp_pos,396,[hex2 master,hex2 destino,hex2 posicao]

    unfortunatly without sucess

    I have no more idea what can be wrong

    Best regards
    visitac

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Serial communication between PIC and Atmega controileer trough RS485

    Just a thought, if you have accidently crossed the rs485 wires, then the signal will be inverted at the receiving end, so your serial data would be inverted.

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Serial communication between PIC and Atmega controileer trough RS485

    With fragment of code and no schematic, I personally think you cannot get much more help. Please post the whole code you are using, along with some reference to the data sheet of the slaves you have installed in your network. Naturaly complete the info with a schematic on the setup.
    With a more complete picture you will have a better chance to get the corrected advice.

    Cheers

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Nov 2011
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Serial communication between PIC and Atmega controileer trough RS485

    Hello aratti,

    The network is only one master, the pic controller, on there i use serout2 and a 7segment display as slave, that use a Atmega88P. Both with baud 2400
    The display works fine on other project as slave too on baud 38400, all with Atmega controllers. The display is not a problem, the protocol is the same,
    only on this project with the pic i have change the baud to 2400. With software uart it not possible to work on baud 38400. Why i have change the baud on the
    display to 2400.

    I can draw a schematic tomorrow, but like i said the display is working on the other project. On the board with the pic i have connect PORTE.0 to pin 4 and PORTE.2 to pin 1
    of the max487. The pin 2 and 3 of the max487 connect together to PORTE.1. On startup make the PORTE.1 as output and high for transmit mode. A is connected to A and B to B of the max487 on the display.

    Best regards
    visitac

Similar Threads

  1. USB / RS485 communication
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th May 2009, 19:36
  2. rs485 communication
    By dreamman in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2007, 21:47
  3. RS485 serial communication
    By mipie in forum Serial
    Replies: 5
    Last Post: - 10th February 2007, 13:15
  4. PIC to PIC RS485 with users the communication
    By x0914667 in forum Serial
    Replies: 2
    Last Post: - 21st July 2005, 00:20
  5. put an id adress on one pic for rs485 communication
    By ON4XAV in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th June 2005, 12:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts