G oog le BadWeB | Login/out | Topics | Search | Custodians | Register | Edit Profile


Buell Forum » XBoard » Archive through June 12, 2012 » Anyone hookup ECM to LabVIEW/Arduino? « Previous Next »

  Thread Last Poster Posts Pages Last Post
Archive through May 13, 2012Timebandit30 05-13-12  10:59 pm
Archive through April 30, 2012Blaylock198830 04-30-12  11:36 pm
Archive through April 03, 2012Greg_e30 04-03-12  10:04 pm
Archive through March 05, 2012Msamuels030 03-05-12  12:34 am
         

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Monday, May 14, 2012 - 12:03 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Timebandit, that being said, my colleague at work has built an ABS braking system for UAVs using an Atmel 328p (totally gutless processor). All it's doing is triggering an interrupt driven by a Hall effect sensor (mag trigger) to acquire wheel speed. After that, it's doing some simple math in the Arduino IDE to compute some terms and it's a done deal. System is effective in getting quarter million $ UAVs to stop without crashing.

The need for a more powerful MCU is definitely tied to the application it's due for. The Cortex M4 MCU you've got would be able to process all the autopilot functions necessary for the latest bolt-in autopilots, including GPS/INS, Kalman filtering for the NAV filter, CAN bus I/O, RS232 I/O, and whatever additional computation is necessary. It would definitely be able to replace the MCU in the Buell ECM!
Top of pagePrevious messageNext messageBottom of page Link to this message

Nightsky
Posted on Monday, May 14, 2012 - 12:53 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Arduino uses an ATMega2560.
That's an 8 bit 16MHz processor.
I want 32 bits, preferably native float support so math just works.
To emulate a simple 32 bit add will take at least 4x the clocks. A float multiply will take 10x that. So a simple scaling multiply for logging takes 40x the clocks for 32 bit numbers on an Arduino. 16MHz/40 isn't fast.

I'll avoid 8 bit anything if there are alternatives. Arduino has great support, but I'm trying something modern.
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Monday, May 14, 2012 - 01:01 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Stay away from Cypress if you want CAN bus. We discovered that while Cypress touts that they support CAN bus, the chip has errata that prevents it from actually working! Bad Cypress.
Top of pagePrevious messageNext messageBottom of page Link to this message

Nightsky
Posted on Monday, May 14, 2012 - 01:15 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

If I was going into production, the goal would be to use the cheapest processor that could do the job.
For this one time hobby project, excessive compute power and cost is OK. It'll be fun.
Top of pagePrevious messageNext messageBottom of page Link to this message

Reepicheep
Posted on Monday, May 14, 2012 - 10:38 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

The PIC 16F and 18F chips both have good "free" compiler options for hobbyist use.

On the 18F, you can use an alternate (HighTech C I think) compiler, or the PIC supplied C compiler, both within the MPLAB microchip supplied IDE. It lacks emacs key bindings, but other than that is fine. I tried both, and liked both, and settled on the PIC supplied compiler just so there is one less knob to twiddle.

On the 16F, I used HighTech. I think at the time it was the only "free for hobby use" one. But now I think the MPLab compiler might be free as well.

Both compilers produce decently compact code and worked well for me. You can buy a license to ger more aggressive optiminzation, but I haven't needed it yet. Since I am coding in C I can do a pretty job of making my code reasonably compact to begin with.

It's a different scratch for a different itch though... I picked the PIC chips as a replacement for simple analog circuits I would build. For that it rocks. $8 worth of hardware for a completely functional circuit to do something interesting (which includes extra external things like a few LED's, thermistor, and a really nice little MOSFET). I can solve a LOT of problems with that same little setup. Only 2k or so of code, but you can replace pages of analog components with 2k worth of compiled C code. I'll use them to drive an LCD while I debug and develop, but otherwise it's just a buried robotic brain somewhere that does a single useful thing well and blinks a couple of three state LED's to say what it needs to say.

The Audrino is a great next step up, if you are going from the old classic goal of a microcontroller and to the more modern goal of a what is really an embedded computer.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Monday, May 14, 2012 - 03:23 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

I've been asked questions in one of my other project threads about why i'm crazy enough to look for a Cortex board instead of the Arduino. Rather than thread-hopping i think it makes sense to keep the conversation in one place, so I'll answer that question here.

For a hobbyist computing platform what it really boils down to is how much processing power you need for the application, where the pain threshold is regarding cost, and whether the board will be a single-use item or something that may become re-used in other/more complex projects in the future. And then there's another factor that plays a large role in making these decisions as a hobbyist -- what features do I really want? Do I want a reasonably priced modern/state of the art processor like an ARM product, or do I want a dirt cheap piece of 8-bit hardware that has more in common with a 1970s-era 8080?

The problem with the Arduino is that if you turn a blind eye to components, it costs as much to manufacture that board as it costs to manufacture a better equipped board, so a significant portion of the manufacturing expense involves mechanical sunk cost rather than computational sunk cost. The result is that marginal cost to improve perf on the board becomes ridiculously small as we're seeing here. ARM Cortex boards are dirt cheap for what they are. Sure, Arduinos seem "cheaper," but when you normalize performance cost, they can't compete in terms of MIPS per dollar. This is because as manufacturing costs get cheaper, the next generation of processors become cheaper to produce while obsolete processors don't.

IMO the future lies ahead, not behind, so I'm choosing a state of the art processor. It doesn't matter to me if that's overkill -- like Nightsky said, the project will be more fun that way.
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Monday, May 14, 2012 - 04:29 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Well, you won't be disappointed with an ARM Cortex MCU, that's for sure. It's the cost of a compiler if you need to build larger applications that will be painful. However, this is true of any platform.

Something I'm unsure of is how the GNU compilers for ARM were developed. I would assume however, that it would be possible to build unrestricted binaries using the GNU compilers. That way, you could use a nice IDE (Emacs, Visual Studio, etc.) to invoke the compiler and linkers manually.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Monday, May 14, 2012 - 05:58 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Since I'm not thinking about going into production and I'm only building for one board, it seems like the TI IDE that's married to the board is a good place to start. Like you say, the final answer might involve finding a way to use the GNU compilers with your favorite IDE.
Top of pagePrevious messageNext messageBottom of page Link to this message

Blaylock1988
Posted on Tuesday, May 15, 2012 - 03:02 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Mesozoic: That is so awesome what your college did with the UAS. What platform is he working on? I am getting stationed with the USAF Space Command Global Positioning unit in LA. Maybe I can use some of my Arduino skillz on the satellites :P

Man, I don't understand half of the stuff you guys are talking about. I wish I had more experience with electrical and computer engineering. I have determined that the thing holding me back right now is a shortage of SRAM of the Arduino Uno. I am going to upgrade to an Arduino Mega that has plenty of memory for my program to run.

Luckily all I need is the simple "gutless" processor for recording data and simple math. If I were trying to do temperature, pressure, inertial and rotational torque and force calculations at different crank angles, I would need a WAY more powerful chip. Right now I have to do all that stuff in Excel.

I don't know if the DDFI-2 ECM is capable of CAN. I would like to learn how to communicate using CAN, then I could start another project with my new VW GTI.

(Message edited by Blaylock1988 on May 15, 2012)
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Tuesday, May 15, 2012 - 03:58 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

I have determined that the thing holding me back right now is a shortage of SRAM of the Arduino Uno. I am going to upgrade to an Arduino Mega that has plenty of memory for my program to run.

For the cost of buying an 8-bit Arduino once and needing to buy a better 8-bit Arduino, you could probably have just bought the latest 32-bit Stellaris board. It has 3D accelerometers built into it. Here's a picture of the board that arrived yesterday, right after shaking it. Notice that the accelerometer traces are showing a wiggle from when the board was shaken.


(Message edited by timebandit on May 15, 2012)
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Tuesday, May 15, 2012 - 04:02 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)



Top of pagePrevious messageNext messageBottom of page Link to this message

Blaylock1988
Posted on Tuesday, May 15, 2012 - 08:34 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

oh neat, it has a screen built into it too. So how would I go from my program on the Arduino to working with a board like that? I don't know real C, I only know Arduino C/C++ stuff.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Tuesday, May 15, 2012 - 08:41 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Porting code from one platform to another would be just as glamorous and fun for a project like this as it would be for any other project -- it would be tedious. But if your block of code is small it wouldn't be a big deal.

The nice thing about these boards is that you can download the CD with all of the documentation by registering at TI and agreeing to the non-export technology agreement. Then you can download the CDs and browse through the PDF documentation.

I can't say much about support. No experience yet.
Top of pagePrevious messageNext messageBottom of page Link to this message

Blaylock1988
Posted on Tuesday, May 15, 2012 - 08:51 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Does it come with its own program that you type your code into and upload? I don't know what types of functions I have in my code are specific to the Arduino, or how to convert it if its different

This is my code http://arduinobuell.blogspot.com/p/code.html
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Tuesday, May 15, 2012 - 09:54 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

I know that there are many different IDEs that you can choose from, but I have no experience with them. If you have specific questions, you're going to have to do the same thing that I'll have to do to find the answer: RTM.

That's one main difference between the serious platforms like this one and the hobbyist platforms. The hobbyist platforms are widely supported in the open source community and you can ask other hobbyists for advice. With the expensive professional IDEs the support paradigm is different -- support comes from the vendor and you have to buy it. I can't answer questions about that due to lack of experience with these tools, but if budget and need for support will be major factors for you, maybe the hobbyist kit would be a better choice.

(Message edited by timebandit on May 15, 2012)
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Tuesday, May 15, 2012 - 10:21 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

As far as porting code, Arduino should drop right and compile as C code. Things like Serial and LCD will need to be ported. The Stellarisware libs provide an API to do exactly the same thing, but you'll need to manually configure the Serial (UART). There's so many ways to configure it, but there's numerous examples provided to get that up and running quickly too. The IDE to configure the compiler is a little bit more complex, but it gives you more options. It's not watered down at all which may be daunting at first to a newb. However, there's lots of example projects that will compile and run right off the bat so you can get a feel for it immediately.

As far as sending code to the chip, there's a tool called LMFlashProgrammer which you can download from TI (should be on the disk that came with the board). The supplied USB cable will let you flash the board from your PC after you install the FTDI drivers. I believe the board will show up as Stellaris A and B, depending on the board.

For support, look no further than TI's E2E forums, there's a ton of traffic on there and lots of people posting and resolving issues. The support is good on the forum.
Top of pagePrevious messageNext messageBottom of page Link to this message

Reepicheep
Posted on Wednesday, May 16, 2012 - 11:25 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Cool board Timebandit! Is it $150?

I was trying to follow the other threads... is there an IDE / Development platform for it that hobbyists can practically use? Or is that another $500 or something?
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Wednesday, May 16, 2012 - 02:54 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Yes, the board costs about $150. That's the good part. You really don't want to know what the IDE platforms cost. That's the bad part.

Check out those links that were posted earlier in this thread. TI gives you the choice to buy four different versions of the board that come packaged with different IDEs, for about $150. The IDEs are sold separately. The IDEs that come with the sample board are test-drives that are all limited in some way: for example, some limit code size, others limit the license to 30 or 60 days, etc. You have to choose your poison when you order the board, but you can also download the crippled/test software from the TI website.

As far as the unrestricted IDEs go, the cheapest license I found for the IAR Embedded Workbench IDE that Mesozoic recommended costs over $3000. Most hobbyists will probably end up choosing something else.
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Wednesday, May 16, 2012 - 04:08 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Hey, I just stated that IAR Embedded Workbench is the best IDE I've seen for working with ARM. Yes, it's best left for professionals due to the cost. You can download a fully functional evaluation from them for free, though. Expires in 3 months or something.

A more realistic alternative is Rowley Crossworks for ARM. http://www.rowley.co.uk/arm/index.htm

The pricing is very competitive and they even have a hobbyist license available which makes it even more attractive. Check it out:
"Personal Non-Commercial License $150.00
A license for hobbyists that want to play with hardware for fun! No guaranteed support and certainly not for commercial development. Before we issue any activations of this license we need a signed non-commercial agreement on file: click here, fill out the form, and return it to us. "

http://sites.fastspring.com/rowley/product/crosswo rksforarm

As with all IDEs, download an eval for free first and see if you like it. I found that my team couldn't afford IAR, I would've gone with Rowley.
Top of pagePrevious messageNext messageBottom of page Link to this message

Reepicheep
Posted on Wednesday, May 16, 2012 - 04:19 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Give away the razors, sell the blades...

Still a cool board though! I like the embedded little cell phone graphical display. Cheap and flexible.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Wednesday, May 16, 2012 - 04:29 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Thanks for that link. I'm still undecided about what sort of IDE I'll end up using, so that link is helpful. I notice that the rowley product also supports linux and solaris. IAR doesn't support 'nix.

I notice that the personal version of rowley is $150, the educational version is $300, and the commercial version is $1500. $1500 is still pretty cost-prohibitive for anyone that's thinking about building something as a hobbyist and sharing it with other people. Those licensing paradigms effectively milk the commercial developers and kill-off ARM as a platform for most hobbyists who are interested in a community-type project. the cost of getting into the developmental license pretty much forces you to sell your product to the community for real money to recoup your investment, rather than allowing you to give it away. that sort of takes the fun out of it. : (

i think that the concept of a 30-day demo is pretty outlandish. perhaps if you were working on a project full-time in a commercial environment you could complete an evaluation in that much time, but for night/weekend projects, such sort term evaluations are just unreasonable. the more complex IDEs take quite a bit of time to get set up and evaluate. a 30-day trial run pretty much forces you into an impulse decision.

i wonder how many people skew their hardware clocks.
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Wednesday, May 16, 2012 - 04:54 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Well, there is still the GNU compiler for ARM which has to be open source. You can use Visual Studio Express to invoke builds. Both of which are free, but require some time to setup and work properly.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Wednesday, May 16, 2012 - 05:39 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

That sounds great in theory, but in practice the open source solution looks like it is dragging it's feet. The downside to GNU for ARM is that it appears to have been stagnant for the past several years:

http://www.gnuarm.com/

The current releases of GCC toolchain are 4.6.x (stable) and 4.7.x (testing). The GNU for ARM GCC compiler is based upon GCC 4.0.x (linux) and 4.1.x (cygwin).

The compiler appears to support M3 but not M4. The toolchain is stale. Do you know anyone who is actually using it?

In addition to not supporting the current crop of processors, the GNU for ARM project is based upon some versions of GCC that were just plain Bad. I was the primary developer/publisher of two source-code based linux distributions, and I know from experience that GCC 4.0.x and 4.1.x were never fully stable. I won't consider using those compilers because of internal problems with the toolchain that were never fixed in those releases of the toolchain. The GCC for ARM toolchain needs to be updated. Unfortunately it doesn't look like it's been updated in at least 5-7 years.

At this point it looks like the open source solution is illusory. GCC for ARM needs to advance out of 2005-2006 to be a contender.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Wednesday, May 16, 2012 - 05:44 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Wednesday, May 16, 2012 - 05:53 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

retraction: the old versions of the compiler that i mentioned definitely don't support M4, but it looks like the latest stable version, 4.6, has added m4 support:

http://gcc.gnu.org/gcc-4.6/changes.html

you might have to roll your own toolchain though.
Top of pagePrevious messageNext messageBottom of page Link to this message

Nightsky
Posted on Thursday, May 17, 2012 - 12:44 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

I;m getting this message when I try to launch the debugger. I'm using Code Composer:

Cortex-R4 CPU Simulator/ARMxx_0
Can't Initialize Target CPU:
Error in getting configfile from driver config database.

Any ideas?
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Thursday, May 17, 2012 - 11:55 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

What device are you using to debug? It will probably need to be set to Stellaris FTDI or something similar if you have the board.
Top of pagePrevious messageNext messageBottom of page Link to this message

Timebandit
Posted on Friday, May 18, 2012 - 10:11 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

The "Up and Running in 10 Minutes" claim by TI is wishful thinking.

The instructions to help you get started are really lacking, even after you've combed through the PDF files on the CD. There are lots of undocumented features and checkboxes, and not much guidance to rely upon to get things properly configured. After following all of the recommended installation instructions, the first attempt to compile resulted in a complaint about a missing config file.

The TI support engineers claimed that they haven't heard of this error before, but in reading the support board at TI, other people have been reporting the exact same problem. This is basically a software error.

TI's standard suggestion is to import some of their projects and try to compile/run them. Doing that only results in new/different errors.

Once you finally get the compiler working, you find that the virtualized debugger doesn't work. It's obviously a software problem that TI hasn't bothered to fix yet. Two nights into the trying to set-up the board, it's an exercise in frustration, even for someone who works in IDEs in industry. After a while you come to realize that the problem is that the target probably isn't properly configured, but there are maybe 20 check boxes for you to fill out, and no board-specific documentation about how to configure the selections to get started with the M4. All of the examples in the walk-through instructions are non-M4. They're all for other boards, and aren't at all helpful.

After 4 full days, it seems like the only way to find the answer is to get on the telephone and try to talk to a real person.

The M4 documentation/ configuration instructions/ coding examples in the TI-branded package are definitely not ready for prime time.

I guess this is what happens when you opt for the inexpensive/free TI-branded tool set instead of the expensive proprietary IDEs: you end up relying on a platform that hasn't been finished yet.

If anyone's interested in this platform, you should plan on spending a week of evenings just to get it up and running. This platform definitely does not work out of the box using the stock installation due to software errors. It takes a several evenings of headbanging just to get it to write "Hello World" with full debugging. Ouch.
Top of pagePrevious messageNext messageBottom of page Link to this message

Nightsky
Posted on Sunday, May 20, 2012 - 12:57 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

I've had enough of this board after 4 nights. Gonna step away from it for a bit.
There's a lot of reading to do to figure out if I'm doing things correctly.
Top of pagePrevious messageNext messageBottom of page Link to this message

Blaylock1988
Posted on Monday, May 21, 2012 - 09:56 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

Ha! how about 3 full months of mashing your head against a wall with a new board and language you have never used before...
Top of pagePrevious messageNext messageBottom of page Link to this message

Mesozoic
Posted on Monday, May 21, 2012 - 10:31 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Custodian/Admin Only) Ban Poster IP (Custodian/Admin only)

It's the language barrier that'll get ya!
« Previous Next »

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Post as "Anonymous" (Valid reason required. Abusers will be exposed. If unsure, ask.)
Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Tree View | Search | User List | Help/Instructions | Rules | Program Credits Administration