Shop OBEX P1 Docs P2 Docs Learn Events
Using DHB-10 with Arduino Mega — Parallax Forums

Using DHB-10 with Arduino Mega

geistmategeistmate Posts: 14
edited 2018-08-22 21:09 in Robotics
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.
2048 x 1536 - 463K

Comments

  • 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: 14
    edited 2018-08-22 21:32
    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: 3,449
    edited 2018-08-23 06:13
    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: 3,449
    edited 2018-08-23 06:27
    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: 14
    edited 2018-08-23 21:51
    [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: 14
    edited 2018-08-23 22:04
    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: 3,449
    edited 2018-08-30 12:09
    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.
  • TCIIITCIII Posts: 81
    edited 2019-07-02 23:57
    Hi All,

    I realize that this thread is somewhat old, however I am having the same communication problem between either my Arduino Uno and my 2560 Mega and the DHB-10.

    I have followed the Troubleshooting Your Arlo + BOE Shield Guide

    Both the Uno and the Meg transmit successfully to the DHB-10 and receive successfully from the DHB-10. However both the firmware and hardware responses are definitely received, but are garbled.

    I get the following response:
    fwver = 0
    VER\r \r
    hwver = 1
    HWVER\r 1\r

    The fwver = 0 response is obviously wrong, however the hwver =1 is correct.

    Changing the Arduino program code to request both the firmware version and the hardware version twice in a row definitely improved the receive function and I could somewhat tell that the firmware version is 10 and hardware version is 1.

    I definitely believe that the Propeller cannot pull down the Arduino Uno/Mega pin 12 input (which has around a 20k pull up resistor) to 0 volts sufficiently for reliable communication. I suspect that a level shifter to convert the Propeller serial output from 3.3v to 5v will possibly solve the problem. If so, where can I conveniently pick off 3.3vdc from the DHB-10 board to supply the low voltage for a 3.3v to 5v level shifter.

    Comments?


    Regards,
    TCIII
  • is it possible to disable that Arduino internal pullup resistor? I thought there was a code setting for that ?
  • VonSzarvas wrote: »
    is it possible to disable that Arduino internal pullup resistor? I thought there was a code setting for that ?

    That was tried on the other thread concerning Arduino Uno communication with the DHB-10 and it did not improve the communication whether the pull up resistor was enabled or disabled. The Propeller Serial Tx line just can't pull the Arduino Rx input to or near 0 v. Therefore a level shifter will probably have to be used to overcome this issue.

    Regards,
    TCIII
  • Hi All,

    I sent Parallax Support an email documenting the Propeller to Arduino communication issue as it has evolved in this thread yesterday.

    Today I verbally followed up my email with a telephone call to Parallax Tech Support. I reiterated what I had sent in my previous day's email and the support tech indicated that they are aware of the Propeller to Arduino communication issue.

    Apparently they are working on a solution, however that will not help those of us who have already purchased a DHB-10.

    Hopefully they might come out with instructions on how to insert a level shifter between the Propeller and the Arduinos to insure that the Arduinos will be able to accurately receive Propeller serial communication.

    Regards,
    TCIII AVD
  • VonSzarvas wrote: »
    is it possible to disable that Arduino internal pullup resistor? I thought there was a code setting for that ?

    I did disable it but I got the same result. The way to do this in code, I believe, is to simply set the input pin to LOW with the following:
    digitalWrite(12, LOW);
    

    What I'm unsure of is if this is effective while still using the SoftwareSerial library to define the pins which is what the Parallax provided sketch uses. Adding pin definitions within the context of using the SoftwareSerial may give me unreliable results. Indeed, It didn't work at all unfortunately.
  • Tarkahn2019Tarkahn2019 Posts: 17
    edited 2019-07-03 20:20
    @TCIII
    You did my work for me! now I feel bad. I was going to call support but got busy with pre-holiday accounting work for my business. So thank you for posting about your call and email to Parallax support. I have a couple of stamp BOE boards and a propeller stick that I got several years ago. I'm not against using any of those for the initial stages of development just to get things moving. I also had no trouble using standard PWM to get the motors moving so there is no reason why I can't compromise at this early stage of dev. Long term I'd prefer to have the Arduino in the chain, partly because it works well with my Jetson nano.

    I'll research possible propeller to Nvidia Jetson Nano integration. As of now, because of your call to Parallax and the known problem (which is not documented in the tutorial) I will consider the matter unsolvable and move on to an alternate path.

  • I did disable it but I got the same result. The way to do this in code, I believe, is to simply set the input pin to LOW with the following:
    digitalWrite(12, LOW);
    

    What I'm unsure of is if this is effective while still using the SoftwareSerial library to define the pins which is what the Parallax provided sketch uses. Adding pin definitions within the context of using the SoftwareSerial may give me unreliable results. Indeed, It didn't work at all unfortunately.

    Makes sense. And measuring the Arudino IO to ensure the pullup is really disabled would seem most important to solving the unknowns.
Sign In or Register to comment.