I've been doing a hooby project in C for the PIC18F series. I've become frustrated with the PIC, manufacturer's example code doesn't compile, getting certain "modern" functions (SD, USB updates, bootloaders) to run is pretty time consuming for an evening hobbyist. I'm thinking of changing to mbed or Arduino out of frustration.
How difficult to get running is an Ardinuno project that supports the following
Textfile logging to SD card for on-site debugging (non SDHC size is fine)
Firmware updates without a custom debugger (by either SD or USB)
Stepping debugger for development
Free or hobby targeted compiler
Three of your points are fairly easy: logging to SD card (do a Google search for "arduino data logger"), firmware updates (done through the USB port without any extra hardware), and free compiler (included with the Arduino GUI).
The stepping debugger is a bit tougher. It's not a part of the Arduino environment and it will require you to purchase some hardware from Atmel (like the Atmel JTAG ICE mkII) and use a separate program that supports single-step debugging (like Atmel's AVR Studio).
--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
Firmware updates, you need a PC to download new sketches without writing/modifying the bootloader to reprogram itself from an SD card.
Arduino is not a USB master, don't think you'd be able to control a USB card for downloads.
Never tried a stepping debugger, most programs you can just add a serial print here & there to see what the program flow is doing, or spit out a variable value.
I can't print text to a file, I should have explained. I want to log UART messages received and sent to check for unexpected or ignored operations.
CrossRoads:
Firmware updates, you need a PC to download new sketches without writing/modifying the bootloader to reprogram itself from an SD card.
OK so I could ask a remote user to plug in a PC via USB or USB-to-serial and load a new sketch to update the firmware occasionally. And is that updater code (both host and PC side) all ready-and-working something I need to repair and debug like for the PIC?
OK so I could ask a remote user to plug in a PC via USB or USB-to-serial and load a new sketch to update the firmware occasionally. And is that updater code (both host and PC side) all ready-and-working something I need to repair and debug like for the PIC?
It's all built-in, ready, and working: update the firmware over USB from a PC/Mac. See here:
OK so I could ask a remote user to plug in a PC via USB or USB-to-serial and load a new sketch to update the firmware occasionally. And is that updater code (both host and PC side) all ready-and-working something I need to repair and debug like for the PIC?
It's all built-in, ready, and working: update the firmware over USB from a PC/Mac. See here:
--
The Quick Shield: breakout all 28 pins to quick-connect terminals
Thanks guys, for really quick and clear help and support.
*Tips hat in your direction
I like the Arduino Mega Atmel Atmega2560, because it has 4 UARTs. It has 256kB of storage.
One problem I came across with PIC was a limit to any variable of a maximum of 256 bytes, unless I hacked the linker file to reserve and enlarge. This caused more time wasted figuring out memory maps and having to unprotect areas of the memory and left me open to memory stomps if I got my pointers wrongs.
My cyclic buffer was an array of structs, each one 40bytes, limiting me to 6 array members. Is there such a limitation in variable size on the Arduino?
One of my students just admitted he went for a more expensive system with less functions, the basic stamp. Same problem, not enough memory.
Arduino UNO's core MCU chip is the ATMEGA328, it has 2KB SRAM for variables, 32KB FLASH for code, and 1KB EEPROM in case you save stuff between power cycles. If that is not enough, you can get a mega, based on ATMEGA1280 or 2560. They have 8KB SRAM, 128KB(256KB) FLASH, and 4KB EEPROM. There are plenty of user created hardware shields and libraries to drive sdcards, gps, LCD, buttons, anything you want.
One problem I came across with PIC was a limit to any variable of a maximum of 256 bytes, unless I hacked the linker file to reserve and enlarge.
There is no such limitation in the AVR development system. You are limited in RAM as mentioned above, but there is no per-variable limit (well...there is at 64K but that's way up there).
--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected
I have received my Arduino, and was impressed that the examples compiled and ran for a Hello World LED fade within 10 minutes.
What makes an ATmeag 2560 behave like an Arduino?
What I mean is, if I wanted to make a new PCB based on the ATMega2560, what schematic and software components would need to be included to give me this simple Ardunio behaviour I am experiencing? A bootloader in the uC for Sketch installation and standard library support? Some resistors to define the target? A USB chip with PID and VID set to identify the target to Windows?
Arduino software is what makes it behave.
The electrical design is posted. Plenty of folks make standalone projects - just need a 10K reset pulluo resistor, couple of power supply decoupling caps (100nF or 0.1uF), 16 MHz crytal, two 22 pF caps, and board to put and your connectors on.
Last post before I get started, and I want to say thank you for being so fast and helpful replying to questions that are probably answered already in searches. You guys are faster and less snooty than the Microchip forum guys.
Is there a way for me to supply compiled code for download to user equipment, allowing me to protect my time investment in the hardware and software? Ideally I'd like to supply a complied file (hex file?) and a simple download program for updates.
Yes. They'll need a PC or equivalent, and you'll need to have USB port on your hardware for the PC to talk to.
Might be other ways as well, this is one of the most straightforward.
Option: Mouser is selling bare Serial arduino cards, populate as much of it as you need: atmega chip (168 or 328), two 22 pf caps, three 100nF (0.1uF) caps, serial connector, couple of resistors & transistors for RS232 level translation & reset pullup, whatever you need for connectors.
Something else the OP might not know (and I haven't looked in a while - so maybe it doesn't matter anymore?) - at one time there was an issue with the avrgcc compiler supporting more than 128K on the 2560 - is this still an issue?