6
\$\begingroup\$

I am thinking about starting a project and was just looking for some general input. Where I work our company currently have remote stations that take data in from a radio link and input the data to a sql database. I am responsible for maintaining the stations and their scripts. Currently they are just running on a desktop pc connected to a radio receiver and an internet connection. I have had some limited experience with working with embedded systems in the past, and would like to explore the possibility of migrating the current setup to an embedded system. The most difficult aspect of the project that I can foresee is gaining internet connectivity to a pic chip and having enough memory for the libraries that would be needed to connect to a sql database. Can anyone recommend a resource so I can learn how to connect a pic chip to the internet as well as any recommendation on what kind of pic chip to use? I know this can be quite a daunting task, but I like to think that I am up for the challenge.

\$\endgroup\$
1
  • \$\begingroup\$ You never said why you want to do this. What's the problem with the current setup? \$\endgroup\$
    – lyndon
    May 16 '11 at 14:32
5
\$\begingroup\$

Some members of the PIC32 family, such as the PIC32MX675F256H and PIC32MX795F512L include an integrated Ethernet interface. An evaluation board for the PIC32MX795 is available: DM320004.

You can also add an Ethernet controller and use Microchip's free TCP/IP stack with their PIC18, PIC24, dsPIC and PIC32 families.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, This looks to be a great place to start. Makes me happy because I have already ordered a pic32 starter kit to wit my feet from microchip.... I have used pic18's in the past. I never knew they had an ethernet interface on board:D \$\endgroup\$
    – Rich
    Aug 30 '10 at 14:50
5
\$\begingroup\$

There are many devices that could fit the bill for you...

If you're looking for ease of programming, consider an embedded Linux solution. You can find a list of possible boards here. Most of these have ethernet on board as well as large external flash and RAM chips. Many have USB host, meaning that USB flash drives or GPRS modems can be added.

On Linux, programming your application is easy. You have a choice of languages (C, C++, python, perl, Java, etc) and it should be straightforward to port your existing PC software. Curl is a good library for HTTP and sqlite is a compact database.

But, this ease comes at a hardware cost. In medium volumes, boards are likely to cost around $80-$120 going down to $30-$50 in high (10K+) volumes.

If you're looking to cut costs further, you'll want to target a microcontroller. Your code is going to end up much more hardware dependent and development will take longer...

Plenty of hobbyist devices use a low end AVR or PIC along with the ENC28J60 ethernet MAC/PHY. See here and here. These systems often use the excellent uIP and sometimes FreeRTOS.

For an integrated solution, TI/Luminary have a range of ARM Cortex-M3 devices with on-chip ethernet MAC/PHY. These devices go up to 512KB flash and 96KB RAM, so are capable of complex tasks. But, you won't fit an SQL database inside.

There's lots of choice - it all depends on your requirements.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks, I like the idea of being able to use my existing code.. it is written in python which would obviously not work for a pic chip. The database will not be housed on the chip it self. I will have to access the database which will be housed on a server. \$\endgroup\$
    – Rich
    Aug 30 '10 at 14:59
  • 1
    \$\begingroup\$ The protocol to access your database may also affect your choice. If you need HTTPS or SSL/TLS, you'll have a hard time fitting that in an 8bit micro. \$\endgroup\$ Aug 30 '10 at 15:02
  • \$\begingroup\$ HTTPS or SSL/TLS would not be needed. I would just need to connect to a mysql database... \$\endgroup\$
    – Rich
    Aug 30 '10 at 15:06
  • \$\begingroup\$ ah the old hammer + walnut... \$\endgroup\$
    – vicatcu
    Aug 30 '10 at 16:16
  • \$\begingroup\$ dspic has a library for asymmetric encryption. i doubt you want to deal with it. \$\endgroup\$
    – Kortuk
    Aug 30 '10 at 17:01
4
\$\begingroup\$

I'll throw in the Arduino option into the mix. An Arduino + a WiShield can get you the ability to periodically post data to a webpage (e.g. on an apache server) over an 802.11 network. Your webserver would then handle the job of putting that data in a database (e.g. a PHP script that handles the posted data). This is probably a good place for you to be on the effort to cost curve. Best of luck, this sounds like a fun project!

\$\endgroup\$
2
  • \$\begingroup\$ Also, you can get servers that include an SD card. This makes it possible to serve up images and complex web pages. \$\endgroup\$
    – Dirk
    Aug 30 '10 at 17:34
  • \$\begingroup\$ @Dirk, or perhaps an SD shield like (seeedstudio.com/depot/sd-card-shield-for-arduino-v21-p-492.html) - but maybe that's what you meant :) \$\endgroup\$
    – vicatcu
    Aug 31 '10 at 13:29
0
\$\begingroup\$

I've been working with Microchip microcontrollers for a long time and I know that family quite well, but I think you would be better served by the solution proposed by the Mbed dev board.

This will give you without doubt the fastest route to have Ethernet running on a microcontroller. Take a look at them, the price isn't too bad either. Also, take a look at the forum, there's already a driver for MySQL, although I don't know the reliability of such driver. I suppose it could be a starting point for your particular SQL database (in case it is not MySQL).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.