Loading...
  Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Programming Questions / Re: Reading the Arduino SD Card on: April 09, 2013, 07:19:30 am
@jdannels:

Which SD Card library are you using?  The pre-installed SD lib referenced here: http://arduino.cc/en/Reference/SD ??

If so, under File Class, you will note there is a read() function.  AFter the Arduino has closed out the last write and the SD card has the file, you will need to SD.open() the filename again and then use the read() to accomplish your send.  This also implies that you are opening a Serial Connection (physical USART or Software Serial) on the Arduino to the outside at a particular BAUD rate.  The Pi must open the same physical TTL connection as read with the appropriate BAUD rate.

I think that the confusion is in all the semantics changes when you change from write mode to read mode.  This should clear up the Arduino end of things:

http://www.ladyada.net/products/microsd/


To simplify the process, just take the Pi out of the equation for a while and concentrate reading a TEXT file from the SD card to the Arduino terminal.  At that point, you are 99% there.  The Pi end will simply read this Arduino text stream and write it where ever you want to put it... eeprom, Flash Card, another terminal, etc.

Ray

2  Using Arduino / Programming Questions / Re: Is Arduino ANSI compatible ? on: April 09, 2013, 06:59:27 am
You may find this discussion also of interest regarding the toolchain:
http://academic.cleardefinition.com/2012/09/21/using-c-on-the-arduino-a-mainstream-c-standard-library-port-for-the-avr/

3  Using Arduino / Microcontrollers / Re: Arduino's reliability on: April 08, 2013, 08:57:01 pm
Quote
I won't have access to the data-logger after I'm done because that solar array is going to be installed in a village in Africa.

Most universities with engineering schools have professors familiar with designs for adverse conditions.  I would approach the college through their outreach department and request a consultation.  You need to approach the concern from a best-practice and system (weak link) perspective.

There are chemical products that can make connectors less likely to fail due to environment, but nothing short of a sealed environmental container can eliminate condensing humidity - sure death threat.

Ray
4  Using Arduino / Microcontrollers / Re: a PIC for arduino? on: April 08, 2013, 06:54:14 pm
http://www.instructables.com/id/PIC-developmenttesting-board/

You can Google for more.  A free IDE is available from Microchip as a 'student' edition... Google for the link.

Arduino is mostly AVR-based, so you need to find a PIC-friendly forum to ask all those remaining questions.  It's just not professional to use Arduino's website/bandwidth to discuss this issue.


Good luck,

Ray



5  Using Arduino / Storage / Re: use SD card to increase the arduino flashmemory on: March 24, 2013, 08:40:58 pm
@naut:

Prob would be wise to ask that question in the Project Guidance area.

6  Using Arduino / Microcontrollers / Re: Best way to program a bare 328P? on: March 24, 2013, 08:18:34 pm
This shield with ZIF works flawlessly:
https://www.adafruit.com/products/462

7  Using Arduino / Microcontrollers / Re: Programming Atmega328 on: March 24, 2013, 08:09:50 pm
Hi
thanks for that topic,

I just changed the bootloader and a compiler massage came up:  error: #error "Clock must be 16, 8, 4, 2 or 1 MHz"

anyway was still fun trying it out.

thx
coolf

This link details both the boards.txt changes and boot loader rebuild:
http://www.grozeaion.com/electronics/arduino/155-overclocking-atmega328p.html

Ray
8  Using Arduino / Microcontrollers / Re: ATtiny85 Limitations? on: March 24, 2013, 12:00:25 am
Most likely, the floating-point lib is your issue...
Try int  just to determine in it will compile and fit into the t85.

- Ray
9  Using Arduino / Storage / off load serial data recording to dedicated 328P and SD card on: March 17, 2013, 07:10:58 pm
I needed a cheap implementation SD recorder for a 9600 BAUD stream from my Mega2560.  The Mega is running dual SPI instrumentation amplifiers for exhaust gas thermocouples, I2C for realtime clock, and bunches of analog inputs for fuel level, battery current, cabin temperature, ambient air temperature, 2 ports for cylinder head temps, and the list goes on.  In addition to acquiring data, the Mega is managing two 16x2 line OLED serial displays.  Adding SD card log recording to this code seemed a bit foolish.  And so I went looking for alternatives and found them starting at $40 and running to $70 for generic recording.  I was not impressed.

The SD card breakout board the plane owner purchased was the LC Studio card, discussed in the forum elsewhere and in a somewhat dim light.  But I had it, so I figured I at least needed to try it before telling my friend to shell out cash for the AdaFruit or SparkFun it alternative shield plus more for an UNO to mount the shield.

I found the schematic for the LC Studio board from a link in this forum.  The 3.3V linear regulator can manage 700mA plus.  The idea of a naked ATmega328P-PU being back fed from the 3.3V regulator on the SD card breakout began to develop.  No SPI level shifting!  Dealing with the incoming serial data from the 2560 is easily done with 2 resistors.

I started the prototype and utilized the <SD.h> library in Arduino 1.0.1.  The final design implements a program buffer if 512 bytes and the buffer is purged when full or when a CR is received in the stream. The CR implementation was programmed to minimize any data line losses from my logging implementation in the 2560.

The final beta code will log a substained serial stream at 9600 BAUD without character loss.  The unit may go higher, but I met my design goal and my FOX character generator is switchable from 4800 and 9600 only.

The beta code, pictures, and write-up are published here:
http://www.instructables.com/id/Under-8-Arduino-Serial-Data-Logger-Record-to-SD/

Ray
10  Using Arduino / Storage / Re: use SD card to increase the arduino flashmemory on: March 09, 2013, 04:34:55 pm
...
where can i find how to write an interpreter language on the Arduino, so i can execute the code on the sd card? 

You may find this useful: http://bitlash.net
And I seem to remember a BASIC interpreter that runs from SD, you may try a forum search.  You could build your "own language" and read from SD and parse the tokens, like http://www.instructables.com/id/Arduino-Scientific-Calculator/

- Ray
11  Using Arduino / Microcontrollers / Re: ATtiny..... Is it really that simple? on: March 09, 2013, 09:33:47 am
Yes. Just as easy as that.  I find in standalone projects I use far more than ATMega uC's. With the bonus they are lighter, smaller, cheaper as well as simpler...

Adafruit sells a ZIF shield (you can easily clone this) for the UNO and I have modified it for 328P and t85P:
http://www.flickr.com/photos/77727388@N06/7119371109/in/photostream

Changing the jumper and connecting ground (2 separate tasks for chip safety... just in case!) allows either uC to be burned.  It is quick, easy, the sacrifice of a real Arduino UNO, but well worth the $22 price.

ON economics, in 25 Qty, the t85's are under a $1, varies from about $0.85 to $0.99 from Newark.  The same 25 qty of 328P-PU will run about $1.99 so the dollar economics are 2::1 in favor of the smaller chip.  However, I have (except for size and power requirements) simply settled on the 328P because of the additional RAM and flash space.  This along makes it easy to create your own library set to link against and be not-too-concerned about flash or RAM issues.

Also, I have 2 MiniPro's hung off of very short USB cables that I use for programming.  Code that runs in the Arduino Mini environment is nearly guaranteed to run on a naked 328P.  Standardizing on the larger chip is a $1 silicon penalty that is most often the better approach (excepting small size and flea-power requirements.)

- Ray
12  Using Arduino / Microcontrollers / Re: Bootloader, Firmware, Sketch Relationship? on: March 09, 2013, 09:05:42 am
<...>
I realize I would have to write some of the USB code myself.  Is there anything about the Leonardo or the USB spec that would prevent it from enumerating as a USB MIDI Device and CDC device at the same time?

I have some VUSB experience with UNO, ATtiny85, and Mini and as a general statement, messing with the USB foundation layer is problematic - primarily due to timing issues.  With HID, key mappings and such can be safely changed, but mucking deeper has been problematic for me... for whats its worth.

The LUFA author's page is here: http://www.fourwalledcubicle.com/LUFA.php and in reading the specs, it appears that the Leonardo will perform MIDI and CDC as the CDC code is implemented in the bootloader section... so that during CDC use the LUFA stack is not active at the same time.  The MIDI personality kicks in after the sketch is loaded and the bootloader resets (exits) the CDC mode (Communication Device Class.)  At least that is the way I read the summary page.

Summary:
LUFA also contains USB bootloaders for the following USB classes:
  • CDC Class, AVR109 protocol compatible (AVRDude)
  • DFU Class, Atmel DFU protocol compatible (Atmel FLIP, dfu-programmer)
  • HID Class, with an included custom cross-platform loader application

Ray
13  Using Arduino / Microcontrollers / Listen to your Clone board - a diagnostic test on: March 08, 2013, 10:37:24 pm
I read a lots of Q/A here about non-official boards and download adapters.  Here is something I learned in the 60's while in the military working with digital circuitry.  With practice and comparing against a "known good" circuit this technique is often faster than an o-scope at figuring out problems.

Old trick:
Use an AM battery portable and tune to an empty area on the lower end of the AM band.  Power the Arduino board with the AM radio on and the internal antenna placed near the 328P... Adjust both volume and tuning to pick up some of the digital signal ... Then try to load a sketch... You will be able to hear the reset.

You may wish to try this on your working breadboard FIRST to get the hang of what you are listening for... The PC board should work the same.  

An UNO will be different in that it has 2 uCs.  By carefully placing the small pocket radio nearer different circuits and orienting the rod antenna, you can zero-in on different functionality.

Ray
14  Using Arduino / Microcontrollers / Re: Bootloader, Firmware, Sketch Relationship? on: March 08, 2013, 10:16:18 pm
Prepare to get various responses since the answer to your question is flavored a bit by the perspective of the responder.

A bootloader is firmware used to load your program (sketch). If (bootloader) could also provide additional features (routines) it would be more appropriately called firmware.  For example, SoftWareSerial could be incorporated into the bootloader to "always" provide that feature for every sketch at the expense of having a larger bootloader  eating flash memory.  Obviously, folks writing large sketches NOT needing the features of SoftwareSerial would be unhappy!

http://morecatlab.akiba.coocan.jp/morecat_lab/MocoLUFA.html
States that Moco for LUFA is firmware and is loaded into the atmega8u2 on an UNO board in place of the default USB-serial firmware.

Sketch is an Arduino program generally written using standard Arduino syntax and within the Arduino GUI.  However, the general term "sketch" is a synonym for Arduino program regardless of the host compile environment: exception, assembly or C code off in a library.  Consider "sketch" your main program, the one with setup() and loop().

Ray
15  Using Arduino / Microcontrollers / Re: Problems Uploading sketch to my Custom Arduino "Uno" on: March 08, 2013, 09:45:31 pm
mrburnette: I have done exactly that. The one on the cicuit board is the UNO chip. However, it is revovable. So, I have been able to breadboard it and program it with the blink and the fade sketch. I have also suspected the OSC as being an issue. I changed that and the 22pF caps. the caps are going to ground.

Old trick:
Use an AM battery portable and tune to an empty area on the lower end of the AM band.  Power the Arduino board with the AM radio on and the internal antenna placed near the 328P... Adjust both volume and tuning to pick up some of the digital signal ... Then try to load a sketch... You will be able to hear the reset.

You may wish to try this on your breadboard FIRST to get the hang of what you are listening for... The PC board should work the same.  An UNO will be different in that it has 2 uCs.

I still think the xtal may be pulled off frequency.  You can try some flux remover with an old toothbrush to clean it up... A hairdryer on low heat will evaporate the alcohol and any water contained in the scrub down.

Ray
Pages: [1] 2 3 ... 5