It has been a while...advice on what uC to choose? :)

Hello,

My first post here! I ran into sparkFun while searching for a uC suitable for my project. I was hoping to get guidance on what to get. I am an EE and have experience with embedded systems and programming micros, but this is a long time ago and was hoping to get this fun project complete with minimal effort. I have been out of this market for a loong time and just got overwhelmed with the controller options. I was hoping to get a quick guidance from here.

requirements:

  • Need to record GPS info with sensor data. IE: continuously monitor and store GPS readouts along with corresponding sensor readouts.

  • stored data will then be compared with current GPS readouts in real time (tricky).

  • large storage space (MB’s), preferable SD card interface

  • sensor will send data serially to uC via single 5V data/embedded clock line at ~ 20Khz

  • I am very much interested in speed of development and would prefer near complete units/kits with all that is required from me is to write high level code and hookup gpios . No Assembly code pls :slight_smile:

  • budget for this at $250 with the GPS receiver.

  • LCD output for debug

  • prefer high performance/memory to make code easy. Prefer not to spend too much time optimizing code and just throw money at the processor.

  • free I/O for future fun :slight_smile:

  • complete development kit is a must, all I have right now is a laptop, a scope. (and lots of hope :slight_smile: )

Items I looked at from Sparkfun:

UAV control unit:

http://www.sparkfun.com/commerce/produc … ts_id=9038

Package tracker (no gps included, no free I/O t integrate LCD :frowning: )

http://www.sparkfun.com/commerce/produc … ts_id=8755

Thanks in advance!

skimo

Would an Arduino work? It could handle the I/O needs (there’s hardware and software available for the platform for interfacing to SD cards and LCD displays and sensors and so on) but I don’t know if it meets your needs for RAM and processing power (16MHz can do quite a lot, but it’s pretty weak compared to the dsPIC or ARM boards you linked) But you can code for it in C, upload code to the Arduino with no hardware apart from a USB cable, and the platform’s physical interface (i.e. placement and spacing of the pins) is popular enough at this point that you can get some of the hardware you’ll need in ready-made “shield” form (for instance, [microSD Shield and [GPS Shield - if you build these with the stackable headers, you can combine the two “shields” and then use the free proto-board space on the microSD shield to mount your sensors…](http://www.sparkfun.com/commerce/product_info.php?products_id=9487)](http://www.sparkfun.com/commerce/product_info.php?products_id=9520)

tetsujin:
Would an Arduino work? It could handle the I/O needs (there’s hardware and software available for the platform for interfacing to SD cards and LCD displays and sensors and so on) but I don’t know if it meets your needs for RAM and processing power (16MHz can do quite a lot, but it’s pretty weak compared to the dsPIC or ARM boards you linked) But you can code for it in C, upload code to the Arduino with no hardware apart from a USB cable, and the platform’s physical interface (i.e. placement and spacing of the pins) is popular enough at this point that you can get some of the hardware you’ll need in ready-made “shield” form (for instance, [microSD Shield and [GPS Shield - if you build these with the stackable headers, you can combine the two “shields” and then use the free proto-board space on the microSD shield to mount your sensors…[/quote]

super Thanks for the info. I researched the Arduino products and I love the “lego” approach. However, I wish they offered a bit more powerful units. I honestly do not know off hand how much proc power I need. However, when I thought out the code, it looks like I will be doing pretty intensive (search and indexing) type of stuff on the fly! (yikes) so prefer to play it safe with a fast proc.](http://www.sparkfun.com/commerce/product_info.php?products_id=9487)](http://www.sparkfun.com/commerce/product_info.php?products_id=9520)

A 16-bit PIC24 will give you 40 MIPS. They are quite easy to use.

Leon

If you want more power than Arduino, check out the UBW32. It’s a PIC32 on a dev board. You write code and upload it directly to the chip via USB. You can also use a standard PIC programmer, which is useful to have around if you ever want to flash the bootloader. It’s not at “lego-like” as the Arduino, but you can use a breadboard with it. You could also design boards that match the pinout so you could drop the UBW module in.

Microchip has the free C32 compiler for C coding. FreeRTOS also supports it, which is my preferred way of doing more complex projects.

There is also a BASIC environment for it, though I haven’t used that personally. Check the PIC USB forum here on Sparkfun. There’s some great info over there for the UBW boards.

skimo:
super Thanks for the info. I researched the Arduino products and I love the “lego” approach. However, I wish they offered a bit more powerful units. I honestly do not know off hand how much proc power I need. However, when I thought out the code, it looks like I will be doing pretty intensive (search and indexing) type of stuff on the fly! (yikes) so prefer to play it safe with a fast proc.

If you’re using an SD card to run through a database for reference, that’s going to be your biggest bottleneck. Any processor is going to be held back with that task.

TheDirty:
If you’re using an SD card to run through a database for reference, that’s going to be your biggest bottleneck. Any processor is going to be held back with that task.

Good thought. Yes. I was thinking of ways to load snippets into RAM based on location, doing the searches there, then flushing to the SD card as the gps travels away from that region. All theory :slight_smile:

Can’t wait to get my hands dirty.

ttabbal:
If you want more power than Arduino, check out the UBW32. It’s a PIC32 on a dev board. You write code and upload it directly to the chip via USB. You can also use a standard PIC programmer, which is useful to have around if you ever want to flash the bootloader. It’s not at “lego-like” as the Arduino, but you can use a breadboard with it. You could also design boards that match the pinout so you could drop the UBW module in.

Microchip has the free C32 compiler for C coding. FreeRTOS also supports it, which is my preferred way of doing more complex projects.

There is also a BASIC environment for it, though I haven’t used that personally. Check the PIC USB forum here on Sparkfun. There’s some great info over there for the UBW boards.

I have been looking up PIC32 since your post and looking at all sorts of posts for the UBW2. The power is great , the module is perfect too. The only negative vs the “package tracker” type is that I will have to implement the SD , LCD and the GPS interfaces from scratch. I have been searching for boards with as much of this stuff already built as possible (to save time).

I ran across this:

http://www.sparkfun.com/commerce/produc … ts_id=8858

Has the SD and LCD Screen. Based off the ARM7 (not PIC32 which I seem to like more after research)

skimo:
Has the SD and LCD Screen. Based off the ARM7 (not PIC32 which I seem to like more after research)

Why do you like PIC32 more than ARM7? I don’t know much about either platform…

PIC32 offers higher performance than the ARM7.

Leon

tetsujin:
Why do you like PIC32 more than ARM7? I don’t know much about either platform…

I am with you and have no real hands on experience with any. I have just been searching for which one has more support, code samples, etc. However, this is a result of just me googling and may not represent reality.

One thing is for fact, once I do get more exposure. I will share back on this forum.

You will find more support for the ARM7, especially if you go for the NXP LPC2000 chips.

Leon

The ARM is more popular to the PIC32. You can try an LPCXpresso board as a quick development board using the Cortex-M3 (latest generation of microcontroller targeted ARM).

There are also some inexpensive AVR32 platforms which compare favorably with the Cortex-M3 line. I’ve found the provided examples from Atmel (part of their “Software Framework”) easy to use and adapt.

Thanks for the tips. I think I am convinced I need to take the ARM route. Now, I need to choose the most “complete” dev board with as much goodies pre-built as possible.

On sparkfun, I found these two:

http://www.sparkfun.com/commerce/produc … ts_id=8755

http://www.sparkfun.com/commerce/produc … ts_id=8823

I cannot explain the fact that they have the exact same price but one includes a $60 GPS receiver! I am thinking of going more with the GeoChron because of it has almost all the parts I need and they even break out some of the free signals via jumpers. The one caveat is no boot loader or explanation of how to place firmware.

The NXP chips have a bootloader using UART0, the FlashMagic software is required. A JTAG interface makes development much easier, of course. I use the Rowley CrossConnect Pro.

Leon

If you want to develop with OpenSource tools, you can’t beat ARM processors. You can select from tool vendors or stick with gcc, ld, as, gdb and openocd. I use Linux exclusively, so the gdb that works on my desktop is the same gdb that I use to debug ARM targets - only one learning curve.

And there is a migration path to higher performance. The Cortex M3 offers better performance than the ARM7dtmi architecture used in the LPC2xxx family. For example check out the LPC1768. There are more in the pipeline and higher level processors like ARM9 chips.

I’m told by someone who works for ARM, that the peripherals such as UARTS, SPI, etc are part of the IP that is licensed by chip fabricators, so that your drivers to handle these peripherals are transportable across vendors.

Chips like the AVR, and I suspect the PIC, don’t allow standard C constructs to be used in program memory space, which is a real drag when you build structures into flash. Because they use a special register to transfer from flash memory to RAM, where standard C constructs work, you’ll find in any complex program that lots of code space and CPU cycles is burned up with function calls to move data.

I have yet to find any real justification for using anything other than an ARM processor unless you’re building millions of something where a penny or two saved is significant.

SOLD! ARM it is! :slight_smile:

I have been looking extensively at ARM LPC2XXX series following guidance from this thread. Indeed, there are tons of projects out there and ample support. Thanks for the advice.

Now, its about which dev board to pull the trigger on. I am trying to think if I will need external RAM or not.

My project is essentially logging GPS data and corresponding sensor readouts. I believe this could be stored on an SD/MMC. Now, the device will be mounted in a moving vehicle, and as new GPS data is collected, it will, in real-time, compare live sensor read outs and compare to pre-recorded sensor data and alert user if there are “changes” in the current sensor data vs recorded at the current GPS location. Since, current GPS data will never really match recorded data, I am guessing I have to be doing some sort of live “proximity searches” and these will be cpu hogs…

(I am trying not to write a navigation software :slight_smile: )

To get as realtime (<1 sec latency) feedback as possible, I am thinking either the entire database of recorded data has to be brought into RAM, or - have some way of pulling chunks of the relevant data (data in the vicinity of current GPS coordinates) from flash into RAM on the fly.

I honestly am not familiar/experience with the capabilities of LPC2xxx and if its strong enough or waaay overkill :slight_smile: for what I am trying to do. I am hoping for the latter.

Happy New Year everyone :slight_smile:

Get an LPC2148 dev board made by Olimex. It has a slot for an SD card, and there are several Open Source file systems to choose from.

After that you need to be creative is how you use the file system. I’ve used a file system in the past as nothing more than a double linked list using integers converted to ascii as file names.

I’ve also used date strings for file names, like 20091231_43. You can do an ls on these and sort if necessary.

I suspect you need to use a lat/lon scheme for file names that allows you to access proximity data based on file names. Of course most file systems out there are DOS/FAT based, with the number of files in a directory very limited, so you may have to use lat/lon as a key or offset into a file.

If you can envision a scheme that works out of RAM, you can “virtualize” that using a file, and with the proper functions that can be mostly masked from the read/write operations.

What you lose with any file system approach is processor cycles. But with a one second update interval you have cycles to burn. My preemptive multi-task scheduler works with a timer tick of 65,535 Hz.

Priority evaluation is done at least this often, but also done anytime a task calls for a system service.

My next advice is this: Write your application on a Linux box and thoroughly test it there before moving it onto a target. I just finished writing a file system strictly for data logging using soldered-in Atmel data flash chips. I used the Linux file system to act as the data flash chips using fseek, fwrite and fread. When it was working and tested I moved it onto the target, where I already has SPI functions that did the equivalent

functions. Total debugging time on the target – ZERO.

Using Linux as your development host for gcc and other tools, a huge amount of code that will eventually run on the target can be written and debugged. When you move it to the target, the only thing changing is the fact the the compiler is producing ARM code instead of X86 code.

Functions like fprintf can be used on the Linux machine, and all you need on the target is a wrapper function behind that to use the UART. In fact I have target library functions for printf and scanf, and guess what - they were written and debugged on my Linux machine before the went into my target libraries. The same goes for a lot of my target library code - malloc/free, strlib, stdio, linked lists, queues, mathlib, . . . .

Take a look at the code necessary. How much of it has to use I/O resources of the target? How much of that can be simulated using resources on you development machine? What’s the time difference between compile-link-program target over just compiling and linking on your desktop?

Using serial ports on Linux is very easy, so acquiring GPS data is a snap. Taking the development process up to higher level is also possible. You could write your application in Python much faster than C. This would give you an idea of it’s complexity. And after you’ve done this, you’d find that writing functions which mimic Python behavior makes translation to C easier.

So now I’m going to revise the advice I gave at the top. Don’t buy a development board yet. Put that decision off until your application is running on your desktop.

One last note: Don’t write C code unless you have to. Write a Python program to generate C code whenever possible. The whole user interface program in my present project is generated by a Python program. It’s the biggest object file on the system because it generates all the user programmable parameter forms, the user display panels, user menus, etc.

All the processor setup code is generated by another Python program, including the I/O, Uarts, interrupts, usb, adc, and more. These are all functions I won’t have to ever write again because I only have to plug in some values into Python dictionaries. And I don’t have to keep looking at pin selection tables in the user manual to make sure the right function is selected, and make sure my defines to select it are correct.

Most of all, have fun!