MyoBridge - Direct Myo <-> Ardiuno Communication


by wxirxn

MyoBridge - Direct Myo <-> Ardiuno Communication

by valentinrol
@wxirxn Hmmm… That should be allright, I was on 1.5.1930 but that should not make a difference. Can you try to find the exact code position where it hangs up? Simply add some Serial.println() statements to the begin()-function in MyoBridge.cpp (somewhere in your libraries directory) and see how far it gets.


It seems to get stuck here:

	///////////////////// Enable All Asynchronous Messages ///////////////////

updateMode();

Last edit: Nov. 27, 2015 04:55 AM

by wxirxn

MyoBridge - Direct Myo <-> Ardiuno Communication

Within updateMode(), it gets stuck at

doConfirmedWrite((uint8_t*)&cmd);
by gilhrpenner

MyoBridge - Direct Myo <-> Ardiuno Communication

When I try to run the CCLoader I get this message: Usage: C:\User\Desktop\CCLoader-master\Windows\CCLoader.exe <com number> <bin file> <device> by any chance anyone of you knows how can I fix this?

Thanks
by eric_castro

MyoBridge - Direct Myo <-> Ardiuno Communication

by gilhrpenner
When I try to run the CCLoader I get this message: Usage: C:\User\Desktop\CCLoader-master\Windows\CCLoader.exe <com number> <bin file> <device> by any chance anyone of you knows how can I fix this?Thanks

I haven't had the time yet to write my part 2, I can do it tomorrow with a step by step but if you're feeling like you can figure it out, ccloader must be executed from a shell window, and as the output you pasted is telling you, the first parameter is the COM port of the arduino, then the path to the BIN firmware file (cc2450 or cc2451 depending on which chip you have) and I dont remember what I put on device but I think it was 0 - I need to recheck where I got that from

None of this will work if you don't program your arduino first with the .ino sketch that comes with CCLoader, which is the arduino code that simulates the CCDebugger none of us have.

I know someone asked for the bin files as the links weren't working, I will also reupload them tomorrow. It's late in France right now and need to get some sleep :p
by valentinrol

MyoBridge - Direct Myo <-> Ardiuno Communication

@wxirxn Thank you. Looks like it locks up when attempting to write to the Myo… Now it would be good to know what hardware you use (Arduino). You could also try to print out the firmware data before this point and see if this is corrent. Do do this, just write Serial.println(firmware_info.major), Serial.println(firmware_info.minor) and Serial.println(firmware_info.patch) before this point.
by wxirxn

MyoBridge - Direct Myo <-> Ardiuno Communication

by valentinrol
@wxirxn Thank you. Looks like it locks up when attempting to write to the Myo… Now it would be good to know what hardware you use (Arduino). You could also try to print out the firmware data before this point and see if this is corrent. Do do this, just write Serial.println(firmware_info.major), Serial.println(firmware_info.minor) and Serial.println(firmware_info.patch) before this point.


Thanks so much for the help so far! (:

I'm using an Arduino Uno, and the way I have it set up is as in the image on the github page: 3v3 to VCC, GND to GND, digital pin 2 to TX, digital pin 3 to RX via a voltage divider, and digital pin 4 to reset via a voltage divider.

I currently cannot test it as my project is in school; I will update you again once I'm back in school (:

Thanks again for all the help!
by wxirxn

MyoBridge - Direct Myo <-> Ardiuno Communication

by gilhrpenner
When I try to run the CCLoader I get this message: Usage: C:\User\Desktop\CCLoader-master\Windows\CCLoader.exe <com number> <bin file> <device> by any chance anyone of you knows how can I fix this?Thanks

Hello! My project also happens to integrate this library with prosthetics (:

Here's a short guide that will hopefully help you out!

1. Solder the appropriate wires onto your HM-10 board as eric_castro has shown.

2. Connect your Arduino to your HM-10 board as shown in CCLoader.jpg in the main CCLoader folder. Make sure that D4, D5 and D6 (on the Arduino) are connected to reset, DC and DD (on your HM-10) over 3.3V only. As eric_castro has mentioned, use voltage dividers or an Arduino that operates on 3.3V. If you aren't sure which pins on your HM-10 are DD, DC and reset, check this page: (https://github.com/vroland/MyoBridge/wiki/Getting-Started-with-MyoBridge-Firmware) under “Connecting to CC Debugger”.

3. Connect your Arduino to your PC and check which port it's connected to. You can check this by simply opening Arduino on your PC and clicking Tools > Port. The connected port will show up as something like COM(number). For example, COM6 means port 6. Make sure the correct board is selected, as well.

4. Upload CCLoader.ino (located in CCLoader-master\Arduino\CCLoader) onto your Arduino.

5. Ensure that CCLoader.exe and your .bin file are in the same folder on your PC. I have re-uploaded eric_castro's bin files here: (https://www.dropbox.com/sh/1smyaq2uoh1z3eu/AABMjAOffYYLgtnzhbdh679ya?dl=0)

6. Open command prompt on your PC (Windows + R -> cmd or simply search for command prompt from start menu), and navigate to the directory where CCLoader is located by using the command
cd C:\User\Desktop\CCLoader-master\Windows
Remember to input the correct path; I used the above path as an example.

7. Run CCLoader by typing in command prompt:
ccloader <port number> <bin file> <device type>
with the appropriate parameters. Port number is the port that your Arduino is connected to (as you have checked in step 3), and device type is the type of Arduino that you're using (0 for Uno/most types, 1 for Leonardo)

For example, if using an Arduino UNO on COM6, I would type:
ccloader 6 CC2540.bin 0

If done successfully, you should see numbers start counting upwards in command prompt, and the RX and TX lights on your Arduino flashing at a constant rate.

I hope this helps! Feel free to ask questions if any of my steps aren't clear enough (: All the best!

Last edit: Nov. 28, 2015 04:55 AM

by eric_castro

MyoBridge - Direct Myo <-> Ardiuno Communication

looks like @wxirxn beat me to it, thank you ! excellent step by step explanation.

on step 2), because you need to flash your CC2541/40 operating in 3.3v, there is a third alternative to voltage dividers or an arduino that runs in 3.3v, which is to use a logic level converter. I used this one from Sparkfun and works quite well:

https://www.sparkfun.com/products/12009 (tested with HM-10)

There is also this one from adafruit but I never tested it:

https://www.adafruit.com/products/757

@wxirxn:
if you have a few bucks to spend, I suggest you ditch your voltage divider setup and get either one of the above, or an arduino you can switch to 3.3v like Funduino UNO or Iteaduino UNO

The reason I say this is because I also tried setting everything up with voltage dividers at first and never been successful for this particular project. However I tested both a direct connection on 3.3v and a 5V connection through the logic level converter, and both worked. Since the issue you're having seems quite strange and difficult to debug, I guess it doesn't hurt to give these a try.

Last edit: Nov. 28, 2015 09:07 AM

by wxirxn

MyoBridge - Direct Myo <-> Ardiuno Communication

by eric_castro
@wxirxn:if you have a few bucks to spend, I suggest you ditch your voltage divider setup and get either one of the above, or an arduino you can switch to 3.3v like Funduino UNO or Iteaduino UNO

The reason I say this is because I also tried setting everything up with voltage dividers at first and never been successful for this particular project. However I tested both a direct connection on 3.3v and a 5V connection through the logic level converter, and both worked. Since the issue you're having seems quite strange and difficult to debug, I guess it doesn't hurt to give these a try.

Alright, I'll give it a shot! Thanks! (: I'll try looking for a Funduino Uno as well.

Another strange thing I noticed is that all of the Arduinos I have (including my friends') output around 6.8V from the 5V port and around 4.4V from the 3v3 port (using a voltmeter to measure the voltage across 5V or 3v3 and GND). I've speculated that this is the cause of my issue, but if this was so then I wouldn't have been able to flash the MyoBridge firmware onto my HM-11 in the first place (I think? I'm not sure if my reasoning is sound). Do you have any thoughts on this? Thanks!
by eric_castro

MyoBridge - Direct Myo <-> Ardiuno Communication

from what you describe, I think the problem is more on your voltmeter than your arduinos. I find it strange that all of the boards you tested are reporting a +1.4V difference - all these pins have regulators behind and it'd be impossible to be above unless they are all broken and malfunctioning equally, which is very unlikely :p

I think you did the flashing right, but your voltage divider setup is doing something strange on the RX line, so the Myo response is not getting through.

do you ever see the “connected!” message on your serial console?

also, did you try swapping your RX and TX wires ? I sometimes waste a few minutes debugging only to find out my RX/TX wiring was the other way around.
Moderator control