News:

SMF for DIYStompboxes.com!

Main Menu

New Arduino addept!

Started by alparent, December 22, 2010, 07:17:44 PM

Previous topic - Next topic

alparent

OK I'm going to get myself an Arduino Uno.  From what I can read on the site. After my MCU is programed, all I need to integrate it into my pedal is a crystal, a 5v reg. and a couple of resistor and caps.

First thing I want to try is a kinda complex switch box.

And then???   This were you come in! Suggestions, links, projects, tutorials. (I've never touched this before!)

I know I've been pestering you guys lately......but I'm all excited and I want to do this right...........and have fun!

Thanks a million.........again!

cloudscapes

I'm almost sure you dont even need a crystal unless you need precision timing or want something other than the default 8mhz.

I dont use Arduino specifically but I use atmel mcus, which are used by Arduino
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

The Tone God

The crystal is needed for timing purpose so the AVR can work with the USB to serial interface.

I've been looking at using a Arduino board for a complex project so I don't want to waste time with making my own USB interface.

Andrew

jasperoosthoek

Control analog pedals with digital pots, if you change the settings on your favorite pedals a lot you cab have presets ;D.

Control big LED displays (sparkfun, nerdkit) for displaying text.
[DIYStompbox user name]@hotmail.com

cloudscapes

Quote from: The Tone God on December 23, 2010, 02:36:32 AM
The crystal is needed for timing purpose so the AVR can work with the USB to serial interface.

Yes but that's for programming only isn't it? Once your uC has been flashed, you don't really need the USB interface at all.

Again speaking from my non-arduino experience. I use raw atmels and they certainly don't need crystals. Even for programming.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

alparent

So after the MCU is programmed I just skip the crystal and use the internal clock :icon_question:

That's even better. Don't know why i didn't thinks of that? 'cause they kinda tell you how to do it on the Arduino site.
http://arduino.cc/en/Tutorial/ArduinoToBreadboard

If you look at the Minimal Circuit (Eliminating the External Clock) section, this is what they are doing.

So I guess the only drawback is that it's slower (8mhz vs 16mhz) but I suppose 8mhz is plenty fast for our need?

The Tone God

#6
Quote from: cloudscapes on December 23, 2010, 09:17:58 AM
Yes but that's for programming only isn't it? Once your uC has been flashed, you don't really need the USB interface at all.

The crystal is there for other purposes then just programming. There are some operations where timing is critical. Just from my recent glancing over the Arduino software they want the user to be able to put a PWM frequency in a header file and have it pop out on the controller. The only way they can do that with any accuracy is to have a crystal and the build process can calculate the setting for the PWM. Some hardware drivers, LCD displays come to mind, need to have specific timing in their communication protocol be it SPI or I2C. In some cases they use one of the internal timers for delays,again  you need to have a accurate clock to have the numbers match. Even look at my strobe tuner I did awhile back. I needed to use a crystal to make sure the string frequencies were accurate.

A big one is the serial protocol. As projects get larger it is common for programmers to use the serial interface to stream live information. The protocol has a fairly strict timing requirement so you need a crystal. This actually one the nice things about the Arduino platform, they have done this for you on the board. They use a serial-to-USB IC that translates the USB connection to serial for the uC so you don't need the added overhead of a USB library on the AVR but since it is serial you need accurate timing. You can of course disable all of this and treat the uC as a raw AVR on a pre-built platform using say ISP to program it which doesn't need exact timing and then use debugWire. Can I possibly mention how much I love having In Circuit Debugging ???

Quote from: alparent on December 24, 2010, 10:19:31 AM
So after the MCU is programmed I just skip the crystal and use the internal clock :icon_question:

So I guess the only drawback is that it's slower (8mhz vs 16mhz) but I suppose 8mhz is plenty fast for our need?

Once again it depends on what you are doing but if you are not doing anything timing critical then yeah you can stick with the internal clock. Unless you crunch a far amount of data, and a beginner I doubt you will for awhile, then I would sweat over the loss of clock cycles.

Andrew

alparent

Thanks for the info Andrew.

Is there anything I can do with Arduino to copy what's in your brains to mine?

Would 16Mhz be good enough?


The Tone God

Quote from: alparent on December 29, 2010, 12:46:15 PM
Is there anything I can do with Arduino to copy what's in your brains to mine?

Do you have any Tiny13s around because thats all it will take ? :icon_mrgreen:

Quote from: alparent on December 29, 2010, 12:46:15 PM
Would 16Mhz be good enough?

Thats plenty. Most of the time I just use the internal clock which is around 8Mhz and I have little issues with most operations.

Andrew