Using DHB-10 with Arduino Mega

geistmategeistmate Posts: 12
edited August 22 in Robotics Vote Up0Vote Down
Hi,
I am trying to use the DHB-10 with the Arduino Mega. I'm running this script here, https://learn.parallax.com/tutorials/robot/arlo/arlo-arduino-uno-boe-shield-brain/test-shield-electrical-connections/test

I am not using a BOE shield; I am just making the individual connections myself.

When I run the test with my Propeller to DHB-10 connection, I get the correct FWVER = 10 and HWVER = 1. When I try to run the test between the Arduino and DHB-10 from the link above, I keep getting FWVER = 0, HWVER = 0.

I am using this previous Parallax forum post for reference: https://forums.parallax.com/discussion/166289/dhb-10-with-raspberry-pi-3

From the DHB 10, I connect the red from both Channel 1 and Channel 2 into a 5V from the arduino. I connect the black from both Ch1, Ch2 into a GND from the arduino. I connect the White from CH 1 to TX pin (defined 12 in the test) digital 12 on the Mega, and the White from CH 2 to RX pin (defined 13 in the test) digital 13 on the mega. I switched both in case I got TX/RX messed up, but both times I cannot get the test to pass.

Can someone give any insight? Thanks. I have attached a picture of my connections in the post.


_ _ _ _

EDIT 1:

So I learned that the B and W pin on the DHB-10 are not connected to anything. I used just a single female to female to connect both CH1 and CH2 to pins P12 and P13 on the activity board, and was successfully run the .side file and return the correct FWVER and HWVER. When I try this with the Arduino Mega, connect it to my pins 12 and 13, still I get HWVER/FWVER = 0.

Comments

  • 11 Comments sorted by Date Added Votes
  • Picture: Just using one jumper from CH1/CH2 to P12/13 on the propeller board returns working serial communication.
    1739 x 949 - 606K
  • geistmategeistmate Posts: 12
    edited August 22 Vote Up0Vote Down
    UPDATE 2:

    I ran the TROUBLESHOOTING test given by Parallax at this link here: http://learn.parallax.com/tutorials/robot/arlo/arlo-arduino-uno-boe-shield-brain/troubleshooting-your-arlo-boe-shield.

    So I have confirmed that I am indeed getting a reply from the DHB-10 however it is by no means correct. At least I am one step closer and know that they are communicating. See picture:
    950 x 588 - 43K
  • VonSzarvasVonSzarvas Posts: 1,258
    edited August 23 Vote Up0Vote Down
    geistmate wrote: »
    Hi,
    So I learned that the B and W pin on the DHB-10 are not connected to anything. I used just a single female to female to connect both CH1 and CH2 to pins P12 and P13 on the activity board

    I think you mean B and R, but actually B is connected. Only R is not.

    Here's a summary:

    B - is connected to GND on the DHB10, and for reliable communications it is recommended to connect those to your microcontroller board, ideally close to the where you are connecting the W cable.

    R - is typically voltage, but you are correct, R is NOT connected to anything on DHB-10 at the CH1 and CH2 pins because these are for data only.

    W - is the signal wire, and accepts PWM or TTL serial signals from your microcontroller board.


    If you connect up the two B (gnd) pins between DHB10 and your microcontroller, does that help ?
  • VonSzarvasVonSzarvas Posts: 1,258
    edited August 23 Vote Up0Vote Down
    Another tip... because R is not connected at the DHB-10 end, it means you can safely use a 3-pin cable directly between DHB-10 and PAB-WX, and that get's you the best GND connection plus the connection should be a bit more robust than just a single cable.

    For the Mega connection, I would start by trying to make the connections as short as possible, and include that GND connection from DHB-10 to the GND header next to Mega's P12-P13, and see if that helps.
  • geistmategeistmate Posts: 12
    edited August 23 Vote Up0Vote Down
    [img][/img]
    VonSzarvas wrote: »
    For the Mega connection, I would start by trying to make the connections as short as possible, and include that GND connection from DHB-10 to the GND header next to Mega's P12-P13, and see if that helps.

    Hi, thanks' for that advice; I did not know that. So what I did this time was I connected the W pins to P12-P13 on the mega, and then I also connected them to the ground terminals on the Mega. It seems I am getting the correct HWVER = 10, but there is a strange 'Y' string in the output. I have to re-set the board to have the blinking orange lights turn on again before I re-run the test, otherwise it goes back to HWVER = 0. The blinking orange lights on the DHB-10 turn off everytime I upload into my mega, I'm not sure if that means anything. (That also happens with the DHB-10 to Propeller WX so I doubt it.)

    Now just need to try some things to get the FWVER right. Any other suggestions / different connections I could try?

    FVQOsyB.png

    Thanks much,
    Matthew
  • geistmategeistmate Posts: 12
    edited August 23 Vote Up0Vote Down
    And yes, you are definitely correct. When I tried it again with just the W -> MEGA, it will not return the correct HWVER. When I then connect the B -> MEGA as well, it will get the somewhat correct HWVER. One step closer.

    EDIT again, yet it is not 100% either on my end. It will sometimes still fail.
  • geistmate wrote: »
    Now just need to try some things to get the FWVER right. Any other suggestions / different connections I could try?

    What happens if you repeat the code line that calls the firmware ver ?
    int fwver = Arlo.readFirmwareVer();         // Check DHB-10 firmware
    fwver = Arlo.readFirmwareVer();         // Check DHB-10 firmware again!
     Serial.print("fwver = ");                   // Display firmware version
     Serial.println(fwver, DEC);
    

  • VonSzarvasVonSzarvas Posts: 1,258
    edited August 30 Vote Up0Vote Down
    Hi @geistmate

    Did you solve this issue ?

    Another forum member just asked a similar question.
    http://forums.parallax.com/discussion/168891/problem-with-dhb-10-and-arduino-shield

    It looks like you are sending the command OK (because DHB-10 replies), but your MEGA is not interpreting the reply correctly. Do you have an internal pull-up enabled (or external pull-up resistor) on the MEGA RX pin ? Could you try disabling that ?

  • Hi @VonSzarvas ,

    Sorry, I was taking a small break from working on my project but I just saw that new post and replied. I bought the BOE shield and tested the connection, however my message still shows as previously before. But, as I also commented on the other post, I passed the Motor Connections test and the Encoders Test. The wheels span, and I also got correct encoder readings on the serial terminal. So I'm wondering if I can just move on. It is unsettling though. I am going to try a few more configurations to see what may come out as a solution. I am running this off of Ubuntu 16.04, and I was having a few problems earlier verifying each sketch. There was an issue with the ArloRobot library in the source code, when it called #include arduino.h. I had to change it to #include Arduino.h in order for it to properly work without errors. However when I run it off of windows, I don't get a problem with just #include arudino.h. I will check now to see what my luck is on my Windows system.
    944 x 582 - 33K
    942 x 580 - 27K
  • As for the internal pull-up enabled, I do not believe so, because I have not enabled anything. Unfortunately, I am unfamiliar with the topic of any pull-up on the serial pins.
  • UPDATE: So, I supposed I never really tried to run the following tests since I never got the connection test to pass; but I tried again simply with the W + B, direct connection from MEGA to DHB-10, and I am again passing the encoder connections test. I wonder if this is an issue with an updated parallax firmware as the BOE shield may be somewhat out of date. If I am able to continue with my project simply with the dual wire connections you suggested earlier, I will most likely return the BOE shield if this cannot be figured out soon, as it inconveniently covers up all the extra pin slots provided by the Arduino MEGA.

    Also, testing on my windows system, the following Encoder tests still pass, but I am still getting failures on interpreting the reply; and this is with having tweaked none of parallax's code in ArloRobot.h.
Sign In or Register to comment.