Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
some kinda jackal
Feb 25, 2003

 
 
"Street cred" is retarded though. The end result is whether you do something awesome with your netduino or not :)

I actually went ahead and skipped the whole Arduino thing and moved up to C programming for ARM Cortex processors. Not because it was more badass or anything, but mainly because it interested me more than learning the Arduino language. If I had anything useful to do I would probably use an Arduino since it'll be far easier and less time consuming to do as opposed to learning how to manipulate registers, etc. :haw:

Adbot
ADBOT LOVES YOU

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy
Ok, I used PROGMEM in various ways and while it now all compiles and works, the scales are no longer in tune, and they go high and low in pitch in a seemingly unpredictable way (certainly not in the organized way they should). In addition, output volume is about halved. I'll assume this is all because of the increased time it takes to pull the information to RAM (or whatever the hell it does).

I'm done hacking away at this for the night. More tomorrow.

Base Emitter
Apr 1, 2012

?
Anybody know about the availability of that shiny new Due ARM board? It's out of stock on the Arduino site, Mouser has it backordered until December, and Digkey and Newark don't list it at all... Is it released and available? Is Mouser actually likely to get boards in December?

I've got a couple of mbed projects that are a better fit for this board with the extra IOs.

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy
http://www.adafruit.com/products/1076

5 in stock at adafruit.

ArchNemesis
Jun 27, 2007
College Slice

Now there's one less in stock! Thanks for the tip! Can't wait to start playing with this thing. I've been using an Arduino Mega (actually an old ArduPilot Mega board) and I've been wanting something with more power.

VERTiG0
Jul 11, 2001

go move over bro
So I want to build this DIY "ambilight" system up on adafruit for my HTPC setup: http://learn.adafruit.com/adalight-diy-ambient-tv-lighting

It uses an Arduino, and I have never touched any of this stuff before. The last programming of any sort I've done was back in highschool like one of the other posters in here, and that was just the most basic of VB.

I figure before I build that lighting setup I should at least get a grasp on the basics of the world of Arduino stuff.

There's an overwhelming amount of info out there on the topic, so does anybody have a good recommendation on where to start? I was thinking one of those beginner kits that don't require soldering, but are some better than others? I was thinking of picking this up: http://www.canakit.com/arduino-starter-kit.html

VERTiG0 fucked around with this message at 23:07 on Nov 6, 2012

ArchNemesis
Jun 27, 2007
College Slice

VERTiG0 posted:

So I want to build this DIY "ambilight" system up on adafruit for my HTPC setup: http://learn.adafruit.com/adalight-diy-ambient-tv-lighting

It uses an Arduino, and I have never touched any of this stuff before. The last programming of any sort I've done was back in highschool like one of the other posters in here, and that was just the most basic of VB.

I figure before I build that lighting setup I should at least get a grasp on the basics of the world of Arduino stuff.

There's an overwhelming amount of info out there on the topic, so does anybody have a good recommendation on where to start? I was thinking one of those beginner kits that don't require soldering, but are some better than others? I was thinking of picking this up: http://www.canakit.com/arduino-starter-kit.html

A simple kit is an excellent way to start out. You can also find good kits on SparkFun, AdaFruit, etc. I would say that as long as it's got an Arduino included, you can't go wrong. You can use the same board for other projects once you move up. The kit you linked also comes with some essentials you'll eventually need anyways.

Learn to blink a LED. Then learn to do serial communication. Then do digital input/output. Then analog. You probaby won't want to stop once you run that first blinky LED sketch. Don't sweat the programming aspect of it, you'll quickly learn the ins and outs. Look at other peoples' code. Load it up on your board, run it, then tweak it. Welcome to your new addiction.

VERTiG0
Jul 11, 2001

go move over bro
Hahah, excellent. I'm going to snag this kit from SparkFun, as it seems the most comprehensive for the money: https://www.sparkfun.com/products/11227

ArchNemesis
Jun 27, 2007
College Slice
Yeah that's a good one. You got your motor, servo, LEDs, transistors, relays, etc. Basically touching on all aspects of things you'll probably get into once you start looking to build your own projects. Go for it.

Base Emitter
Apr 1, 2012

?

Welp, they're out now, and they were out when I saw this post on my phone earlier today.

I guess that means they're released but popular, and I should just be patient until somebody gets them in stock...

Malevolence Jones
Mar 29, 2006

JesusDoesVegas posted:


Delta (or anyone else) do you know of a more concise way to map these scales? Essentially the Auduino assigns a pot to play the instrument (I'm using a softpot for playability). That pot's analog input is mapped to frequencies dictated by the currently selected scale. Here's example of one map:

code:
// Key of C ........C D E F G A B 
uint16_t majorC [29] = {   
    274, 308, 346, 366, 411, 461, 518, 
    549, 616, 691, 732, 822, 923, 1036, 
    1097, 1232, 1383, 1465, 1644, 1845, 2071, 
    2195, 2463, 2765, 2930, 3288, 3691, 4143, 4389
       }; 

uint16_t mapMajorC(uint16_t input) { 
  uint8_t value = (1023-input) / (1024/29); 
  return (majorC[value]); 

I'm not 100% following along with what you want to accomplish, so I apologize if this solution isn't what you're looking to do, but I think you might be able to solve the problem like this:

1) Start with an array of pitch freqencies by semitone, which sounds like the midiTable referred to in the Google Group post you linked.

2) Create constants for each note you'll use as an entry point into the pitch array. Basically, your starting index value for accessing the array. E.g., C = 60

3) Create arrays for each type of scale you plan to use, with the values being the tone pattern. E.g., Major = 2,2,1,2,2,2,1 / Minor = 2,1,2,2,1,2,2

Putting it all together, if you wanted a C major scale... You'd start by looking up the array index for C (60) and the tone pattern of the major scale and then retrieve the relevant pitch frequencies starting with 60 then incrementing the index by 2, 2, 1, 2, etc.

Rat Poisson
Nov 6, 2010

Base Emitter posted:

Welp, they're out now, and they were out when I saw this post on my phone earlier today.

I guess that means they're released but popular, and I should just be patient until somebody gets them in stock...


Maybe take a look at Teensy 3.0, which is a Due-alike in a bread-boardable form factor: http://www.pjrc.com/store/teensy3.html or at http://www.adafruit.com/products/1044 At $19 from pjrc, it's significantly cheaper than the Due.
It uses a Cortex M4. There's a Teensy-specific branch of the Arduino IDE available at http://www.pjrc.com/teensy/.

Both Teensy3.0 and the Due are fairly cutting edge right now, so there are definitely many Arduino libraries that don't quite work on the Cortex boards yet.

ArchNemesis
Jun 27, 2007
College Slice

Rat Poisson posted:

Both Teensy3.0 and the Due are fairly cutting edge right now, so there are definitely many Arduino libraries that don't quite work on the Cortex boards yet.

Likwise, be careful before attaching any old shield to it. The pinout is backwards-compatible, but if you have a shield feeding 5V into one of the inputs, you're gonna fry your chip. It's strictly 3.3V. That said, there are some very interesting and promising libraries already out for the Due, most exciting of which (for me) is the Scheduler.

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

ArchNemesis posted:

Likwise, be careful before attaching any old shield to it. The pinout is backwards-compatible, but if you have a shield feeding 5V into one of the inputs, you're gonna fry your chip. It's strictly 3.3V. That said, there are some very interesting and promising libraries already out for the Due, most exciting of which (for me) is the Scheduler.
I need to figure out a good level converter solution. I'm tired of trying to hack it with resistor dividers and everything's going 3.3.

---

Just got linked to this today.

Hey, wouldn't it be cool to send and receive small data packets wirelessly from your gadget?

....THROUGH SPACE?

http://rockblock.rock7mobile.com/

Rockblock uses Iridium sats to send and receive data. Obviously per-byte it's very expensive, but the pricing really is reasonable for what you're getting. Think of the possibilities for roaming/autonomous vehicles.

Delta-Wye
Sep 29, 2005

Jonny 290 posted:

I need to figure out a good level converter solution. I'm tired of trying to hack it with resistor dividers and everything's going 3.3.

Honestly, for a couple unidirectional signals a resistor divider/mosfet level shifter circuit is the easy way to go (https://www.sparkfun.com/products/8745).

If you have a lot of signals something like this works great, it just increases your part count: http://www.ti.com/product/sn74lvc16t245

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy
Update on my auduino project.

I made a post on the arduino forums and the guy who runs this blog contacted me. While he didn't run into the same issues I had, he already modified the original code to store scales in PROGMEM. It took some figuring out but I was able to tailor his modifications to mine, and currently I've got 36 selections for scales working as designed.

http://pastebin.com/LJp931Yy

Right now all I've got is the same 12 major scales repeated three times, but I'll be adding half whole diminished, and pentatonic minor scales shortly. I also want to sit down with a tuner to make sure it's playing correctly.

Once its playing correctly my next job will be to get the LCD screen to display useful information, and make pretty colors. I got an RGB 2x16 character LCD from adafruit in the mail today. Can't wait to play with it.

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R

Jonny 290 posted:

Just got linked to this today.

Hey, wouldn't it be cool to send and receive small data packets wirelessly from your gadget?

....THROUGH SPACE?

http://rockblock.rock7mobile.com/

Rockblock uses Iridium sats to send and receive data. Obviously per-byte it's very expensive, but the pricing really is reasonable for what you're getting. Think of the possibilities for roaming/autonomous vehicles.

I've worked with these same Iridium modems on a project attempting to cross the Atlantic with a weather balloon, and what rockblock is doing is seriously awesome. I can't wait to see what people start doing with more easily-available hardware and service.

As hobbyists, it was really, incredibly difficult to get any service provider to play ball with us, from acquiring a modem to activating service. Getting technical manuals on the modem was a chore, too. Since then, it looks like the ecosystem has really opened up. These things aren't particularly easy to interact with, but they are very, very impressive.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Are there any good solutions for relay shields that have more than four relays? Or maybe somthing WiFi thats not too expensive? Everything I saw was two or four relays, and the WiFi relay boards cost an arm+leg. I am thinking of replacing my pool pump timers (busted mechanical) and sprinkler controller (ancient LCD) with a Netduino integrated solution, and maybe including outdoor lights too, all controlled from an iOS app.

The pool pumps will need to use DPST high current relays; I'm guessing I will need to set that up on a breadboard myself. Lights would need to be rated for 110v and are a bit scattered around. The sprinklers are low voltage but need a bunch of channels.

Serjeant Buzfuz
Dec 5, 2009

Haha!

I just bought myself a Hitachi V-302 Dual Trace Oscilloscope for less than 10$ brand new in box.

You're all jealous, don't lie.

Serjeant Buzfuz fucked around with this message at 03:19 on Nov 13, 2012

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Here's an arduino-ish project I've started:

I heard about the Teasmade from a MetaFilter post. It's a British alarm clock that also makes tea, but it's a real pain to convert to US circuits because heating elements draw a lot more current than your typical travel adapter puts out.

So I've decided to try to make my own out of a $10 coffee pot. It's kludgy, unfinished, and might not be that great, but I really wanted to try building something.

Here's a video of the first run, with some goony, awkward, unscripted narration. Guess who never has taken a public speaking course. Jump to 5:30 for the actual draining the tea. I'd edit it, but :effort:.

https://www.youtube.com/watch?v=ZgNdF-RVViQ

In the final version, I plan to add an alarm clock mechanism using an outlet timer (I really don't want to have to make my own interface for the alarm clock, and I already have one handy), and a radio tuner or buzzer or something that turns on when the tea is done.

Here's some photos of it, without the servo.

I have a piezo buzzer, so it'd be easy to make it make noise, but I kind of want to do something more ambitious, such as randomly playing something interesting to wake me up, like a "This I Believe" segment from NPR. I guess I could do that with an MP3 shield or one of those cheap iPod Shuffle clones you find for $10 on Ebay/Deal Extreme.

I'm also thinking about a relay so I can shut down the heating element sooner, although the cup did not warm up at all during the brewing process.

This is my first time working with servos. I probably messed something up, or am doing something horribly wrong. :doh: It's mounted on with pieces from an old Erector set.

And for the final version, I'll use a perf-board with an Atmega soldered on, or maybe even an ATTiny (although I'd have to use C and registers), so I can use the Teensy for other projects.

Thanks, goons, for recommending the Teensy. It's really a lot easier than juggling wires between the Arduino and a breadboard. Considering I don't have any shields to use with either my Arduino or the Teensy, I really don't miss that feature.

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy
I'm god damned lost. I've been trying to figure out what the hell is going on with this code all night.

http://pastebin.com/TP9tkL9w

I've gotten myself an RGB 16x2 character LCD from Adafruit, and I've attempted to combine the sketch from adafruit's tutorial with my own.

Adafruit's tutorial: http://learn.adafruit.com/character-lcds/rgb-backlit-lcds

The LCD seems to work exactly as expected, but the Auduino doesn't work. I'll get a seemingly random tone, that holds steady and changes to a different tone every time the RGB on the LCD cycles back to blue.

Both my Auduino sketch, and the sketch from the tutorial work correctly independently of each other, so I know its not my wiring. I assumed I was sharing a pin or a variable on accident, but I don't see any variables that were in both sketch, or any pins that were being used for both.

Pins used in the Auduino sketch are Analog 0 - 4, and Digital 3, 5, and 13.
Pins used in the LCD sketch are 9, 10, and 11 for the back light, and 0,1,6,7,8,and 12.

I know it's not another weird memory issue, since I tried commenting off huge chunks of code and it still works the same.

If anyone feels like taking a look I'd be incredibly grateful.

Serjeant Buzfuz
Dec 5, 2009

JesusDoesVegas posted:


I know it's not another weird memory issue, since I tried commenting off huge chunks of code and it still works the same.


Might be wrong here, but I thought that all the comments were removed before compilation and upload. I don't think removing the comments will affect anything at all.

How much memory does it say you're using?

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy

Gunktacular posted:

Might be wrong here, but I thought that all the comments were removed before compilation and upload. I don't think removing the comments will affect anything at all.

How much memory does it say you're using?

Previously with this project I was running into issues where I was filling up the RAM since I've got a ton of scales I needed to store. Those woes have since been cured with PROGMEM.

The memory readout when uploading sketches is for flash.

The quick test to see if RAM was full was to comment off chunks of those scales. Ya, it just drops them during compilation (I learned that through this thread).

Right now I'm pretty confident its not memory. It's not some sort of shenanigans with duplicate variables and it's not a shared pin. But there's some sort of crosstalk between the two sketches since the synth doesn't work and the notes change regularly with the PWM.

I'll sit down with it today with a fresh mind.

EDIT - Progress! I've sussed out the offending bit of code. It seems the bit that controls backlight PWM in the loop is causing my problems. I still don't know why, but Peter Knight (the Auduino's original author) warns against tampering with the interrupt. Does PWM somehow hinder the interrupt's ability to work?

I liked the RBG LCD screen for its ridiculous kaleidoscope color changing effect. The case I've got in mind for this thing is very colorful, so it fits in. If I have to forgo a seizure inducing LCD screen then it's not a deal breaker, but I'm still holding out hope that this can be solved.

Offending code (from the loop)
code:
  for (int i = 0; i < 255; i++) {
    setBacklight(i, 0, 255-i);
    delay(1);
  }
  for (int i = 0; i < 255; i++) {
    setBacklight(255-i, i, 0);
    delay(1);
  }
  for (int i = 0; i < 255; i++) {
    setBacklight(0, 255-i, i);
    delay(1);
  }
EDIT AGAIN - I was thinking perhaps the delay() was stopping the interrupt from functioning correctly, but according to the arduino reference on delay() it does not affect interrupts.

http://arduino.cc/en/Reference/Delay

WTF.

JesusDoesVegas fucked around with this message at 19:18 on Nov 17, 2012

some kinda jackal
Feb 25, 2003

 
 
Has anyone used an Arduino UNO as an ISP programmer for other AVR chips (such as on a breadboard)?

All the guides I can find seem to specifically mention programming Arduino code onto standalone AVR chips, but I'm interested in writing my own code in C and using the Arduino ISP to upload them to a standalone AVR.

Can I assume that the program that generates the hex doesn't actually matter and everything will work fine if I upload an AVR-GCC hex file instead of an Arduino Hex file?

Sorry if this is really obvious, but I figure this is the case and I just wanted to run it by you guys.

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy

Martytoof posted:

Has anyone used an Arduino UNO as an ISP programmer for other AVR chips (such as on a breadboard)?

All the guides I can find seem to specifically mention programming Arduino code onto standalone AVR chips, but I'm interested in writing my own code in C and using the Arduino ISP to upload them to a standalone AVR.

Can I assume that the program that generates the hex doesn't actually matter and everything will work fine if I upload an AVR-GCC hex file instead of an Arduino Hex file?

Sorry if this is really obvious, but I figure this is the case and I just wanted to run it by you guys.

http://hlt.media.mit.edu/?p=1695

This may be what you're looking for.

some kinda jackal
Feb 25, 2003

 
 
Partly, yeah, thanks. But that page still mentions uploading Arduino sketches to the ATtiny. I'm interested in writing my own .c file and compiling it into a hex with avr-gcc or something, then using avrdude to upload it to a second Atmega AVR via the Arduino in ISP mode.

I guess my biggest question is whether there is any difference between an Arduino sketch compiled into .hex and uploaded or a .c file compiled to .hex and uploaded. My speculation is that there probably isn't, and the CPU will execute just fine, I just wanted to be sure before I ordered a few chips.

If I can get away programming an AVR with the Arduino then I'll just buy some chips. If I can't then I need to spend $40 or $50 on a USB-AVR programmer like the Dragon or something in addition to a few chips. The Dragon will give me debugging and useful things too, but I'm not terribly worried about that just now :)

ArchNemesis
Jun 27, 2007
College Slice

Martytoof posted:

Partly, yeah, thanks. But that page still mentions uploading Arduino sketches to the ATtiny. I'm interested in writing my own .c file and compiling it into a hex with avr-gcc or something, then using avrdude to upload it to a second Atmega AVR via the Arduino in ISP mode.

I guess my biggest question is whether there is any difference between an Arduino sketch compiled into .hex and uploaded or a .c file compiled to .hex and uploaded. My speculation is that there probably isn't, and the CPU will execute just fine, I just wanted to be sure before I ordered a few chips.

If I can get away programming an AVR with the Arduino then I'll just buy some chips. If I can't then I need to spend $40 or $50 on a USB-AVR programmer like the Dragon or something in addition to a few chips. The Dragon will give me debugging and useful things too, but I'm not terribly worried about that just now :)

The only way to upload sketches is by serial. This functionality is handled by the Arduino bootloader. The only thing you'll use an actual programmer is to burn the Arduino bootloader onto your chip. Now, you can program AVR chips directly, for which you'll also use a programmer. I could be mistaken, but you cannot burn the hex file produced by compiling your sketch directly to the AVR, it must be uploaded via the bootloader. You can use another Arduino itself as a programmer, but it only works for the chips that support the ISP programmers. All of this is just from memory and my own experiences, so I could be wrong.

Check the specs on the various AVR chips and programmers. For some AVRs, the cheap ISP programmers from SparkFun or Adafruit should work fine. Some newer chips require the more expensive AVR programmers.

I hope that makes sense.

Serjeant Buzfuz
Dec 5, 2009

JesusDoesVegas posted:


EDIT AGAIN - I was thinking perhaps the delay() was stopping the interrupt from functioning correctly, but according to the arduino reference on delay() it does not affect interrupts.

http://arduino.cc/en/Reference/Delay

WTF.


Which board are you using? Mega? Uno? Something else?

Maybe you mentioned it but I couldn't find it reading your earlier posts. I know that whatever processor you're using affects your interrupts and PWM. I think that on the UNO one can mess with the other due to the number of available timers or something?

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy
I'm using an UNO, but my final product will be on a different board , as I'm currently doubling up one of my analog pins.

I noticed the interrupt is using pwm as well to output a square wave. Is that second pwm going to cause timer issues? If a due would be better perhaps I should bite the bullet and pick one up already.

Serjeant Buzfuz
Dec 5, 2009

JesusDoesVegas posted:

I'm using an UNO, but my final product will be on a different board , as I'm currently doubling up one of my analog pins.

I noticed the interrupt is using pwm as well to output a square wave. Is that second pwm going to cause timer issues? If a due would be better perhaps I should bite the bullet and pick one up already.

I'm trying to find the specific reference right now, but if it was me I'd go ahead and upgrade. I haven't used the due yet but I have a Mega 2560 and its amazing how much more power its got (and more stability) than the UNO.

Serjeant Buzfuz
Dec 5, 2009

Myself posted:

I'm trying to find the specific reference right now, but if it was me I'd go ahead and upgrade. I haven't used the due yet but I have a Mega 2560 and its amazing how much more power its got (and more stability) than the UNO.

So, doing some research on the IC chips behind the UNO and the Mega:

code:
Mega 2560

Timers: 6
Output Compare channels: 16
Input Capture Channels: 4
PWM Channels: 15
32kHz RTC: Yes
Calibrated RC Oscillator: Yes 

UNO
Timers: 3
Output Compare channels: 6
Input Capture Channels: 1
PWM Channels: 6
32kHz RTC: Yes
Calibrated RC Oscillator: Yes 
So in conclusion, maybe?

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy

Gunktacular posted:

So, doing some research on the IC chips behind the UNO and the Mega:

code:
Mega 2560

Timers: 6
Output Compare channels: 16
Input Capture Channels: 4
PWM Channels: 15
32kHz RTC: Yes
Calibrated RC Oscillator: Yes 

UNO
Timers: 3
Output Compare channels: 6
Input Capture Channels: 1
PWM Channels: 6
32kHz RTC: Yes
Calibrated RC Oscillator: Yes 
So in conclusion, maybe?


Uhg... I'm considering just moving on with the project and coming back to this headache later. Hell, given what I posted before for Martytoof I started thinking it may just be worthwhile to run a separate AVR chip to control the PWM. I'm already going to need a power circuit to deal with the Arduino and my echo module, I may as well throw another AVR in there and call it a day.

I was planning on using this board for my final product since its got a really nice small form factor and it has the extra analog pins I need.

valve
Sep 29, 2007
That's well Jackson
I'm not massively familiar with the capabilities of the Arduino, but i'm looking to use one (or a similar microcontroller) for a project I have in mind. I need to read values for up to 64 ADCs (well initially i'll be building with just 8, but the final project will have 64), and then store these values and send them back out to the same number of DACs.

My plan is to drive it all serially, and develop it to have 8 chip selects, with each ADC and DAC IC having 8 devices within (the 8 chip selects bringing to total to the 64).

Is this something that the Arduino is capable of (even for the 8 channels), or do I need something with a lot more power?

(note: it's not an audio interface, it's reading data from a fader, and writing to a VCA for level control-- there is no audio)

SnoPuppy
Jun 15, 2005

valve posted:

I'm not massively familiar with the capabilities of the Arduino, but i'm looking to use one (or a similar microcontroller) for a project I have in mind. I need to read values for up to 64 ADCs (well initially i'll be building with just 8, but the final project will have 64), and then store these values and send them back out to the same number of DACs.

My plan is to drive it all serially, and develop it to have 8 chip selects, with each ADC and DAC IC having 8 devices within (the 8 chip selects bringing to total to the 64).

Is this something that the Arduino is capable of (even for the 8 channels), or do I need something with a lot more power?

(note: it's not an audio interface, it's reading data from a fader, and writing to a VCA for level control-- there is no audio)

First, you might have better luck posting this in the Electronics thread.

You said this isn't for audio - do you know the required sample rate and resolution?
What, specifically, are you trying to do?

There are parts that have 8 or more ADC channels, however you'd be hard pressed to find something similar on the DAC side. It's not really a question of processing power either, it's just the supported peripherals.
You should be able to get to 8 DAC channels if you use filtered PWM outputs, but that will depend on what the DAC is driving, sample rate/resolution, etc.

As far as the Arduino goes, you probably would need to look at the Mega, but you might also look at the MSP430 or Stellaris from TI.

You're not going to find a single part that has 64 ADC and 64 DAC/PWM channels though. If you need all your data in one place, and you really need 64 channels, you'd be better off with some external SPI/I2C converters.

Bruinator
Jul 6, 2005

Martytoof posted:

Has anyone used an Arduino UNO as an ISP programmer for other AVR chips (such as on a breadboard)?

All the guides I can find seem to specifically mention programming Arduino code onto standalone AVR chips, but I'm interested in writing my own code in C and using the Arduino ISP to upload them to a standalone AVR.

Can I assume that the program that generates the hex doesn't actually matter and everything will work fine if I upload an AVR-GCC hex file instead of an Arduino Hex file?

Sorry if this is really obvious, but I figure this is the case and I just wanted to run it by you guys.

I use a USBasp I bought off ebay for less than $4 delivered thats fully compatible with the ISP interface. You can add a couple of lines to the programmer text file and use it through the Arduino IDE. I have had no problems burning bootloaders to ATmega644p and 1284p chips. It should also work through Atmel Studio if you want to ditch the Arduino IDE but I haven't tried it out yet.

Delta-Wye
Sep 29, 2005

valve posted:

I'm not massively familiar with the capabilities of the Arduino, but i'm looking to use one (or a similar microcontroller) for a project I have in mind. I need to read values for up to 64 ADCs (well initially i'll be building with just 8, but the final project will have 64), and then store these values and send them back out to the same number of DACs.

My plan is to drive it all serially, and develop it to have 8 chip selects, with each ADC and DAC IC having 8 devices within (the 8 chip selects bringing to total to the 64).

Is this something that the Arduino is capable of (even for the 8 channels), or do I need something with a lot more power?

(note: it's not an audio interface, it's reading data from a fader, and writing to a VCA for level control-- there is no audio)

You can use an analog mux to get more analog inputs (http://www.arduino.cc/playground/learning/4051 for example). To get 64 inputs, you could use a 4051 on each analog input - 8 inputs, 8 channels each + 3 digital inputs to select channel. Your code would set the digital lines to 000, read A0 through A7, then update those outputs. It would then scan and update 001, 010, 011, etc. As long as it sits in that loop it should be fine.

I think you could do the output with a bunch of different options, but I'm not sure if I know of the /best/ option. SPI potentiometers would be an interesting choice, but maybe a bit overkill? MCP4361502 is a quad pot chip over SPI, so you would need 16 of the chips (~1.88 isn't so bad), SPI hardware, and enough digital outputs to select the right CS pin (probably need a digital mux chip for this).

This solution would limit you to 256 steps on your output, not be able to provide much output current, and also have an update limit which is roughly 64 analogread() calls + a small bit of overhead.

makomk
Jul 16, 2011

Martytoof posted:

I guess my biggest question is whether there is any difference between an Arduino sketch compiled into .hex and uploaded or a .c file compiled to .hex and uploaded. My speculation is that there probably isn't, and the CPU will execute just fine, I just wanted to be sure before I ordered a few chips.
For the record, there are no differences whatsover in terms of programming the actual .hex file to the AVR chip. Behind the scenes the Arduino IDE just compiles everything with avr-gcc and runs avrdude to upload it, and it doesn't use any particularly special options to do so either.

Though to be fair, a standalone USBasp programmer is really absurdly cheap if it supports the AVR you're using...

some kinda jackal
Feb 25, 2003

 
 
Oh yeah totally, I'm just trying to get into and out of AVR development as quickly and cheaply as possible. For the price of an AVR programmer I just bought a few extra ARM Cortex M3 chips to play with, so really I just wanted something to toy around with until my stuff got here :q:

UberVexer
Jan 5, 2006

I like trains

valve posted:

I'm not massively familiar with the capabilities of the Arduino, but i'm looking to use one (or a similar microcontroller) for a project I have in mind. I need to read values for up to 64 ADCs (well initially i'll be building with just 8, but the final project will have 64), and then store these values and send them back out to the same number of DACs.

My plan is to drive it all serially, and develop it to have 8 chip selects, with each ADC and DAC IC having 8 devices within (the 8 chip selects bringing to total to the 64).

Is this something that the Arduino is capable of (even for the 8 channels), or do I need something with a lot more power?

(note: it's not an audio interface, it's reading data from a fader, and writing to a VCA for level control-- there is no audio)

This couldn't be done with an Arduino by itself, you'd need to do some multiplexing to achieve this, or have several DACs connected to the I2C bus of the Arduino. Doing the latter of the two is easier and will probably yield better results for whatever you are doing.

Edit: This should go without saying, but make sure you get a DAC that is I2C compatible.

Adbot
ADBOT LOVES YOU

JesusDoesVegas
Jul 8, 2005

The Funk Ambassador
Lipstick Apathy
So after much floundering and many miss steps, I've pretty much finished the code for my Auduino build. I may go back and tweak the range of the scales, and add a button that has to be pressed to allow audio out (right now it's a drone instrument).

(Nearly) finished product: http://pastebin.com/1KMmLjC0

The LCD PWM is a problem that I'm going to solve with a separate AVR chip... it's a pretty cheap fix, and it's something I want to try anyway. That coupled with the headaches I foresee figuring out timers, and the fact that I'm already getting strange audio effects as my code grows (which sound cool at this point, but much more could ruin the instrument), I don't want this to get much larger.

Right now the LCD displays which scale is selected, and the note that's currently playing. This helps because without the LCD readout it's really hard to know where the hell you are and what you're playing. I want to be able to actually use this thing. Getting to this point looks obvious, but I had a bunch of syntax issues. I asked either here or on the arduino forums for most of the other real long standing issues I came across, so I wanted to solve this one on my own. I learned the difference between an OR "||" and a bitwise OR "|", and that I have to say
code:
if (thing = 1 || thing = 2) 
instead of just
code:
if (thing = 1 || 2)
Again, I'm sure these are obvious for most of you, but it took me a bit to figure out. Using the wrong syntax caused a lot of bizarre things to happen that threw me off.

Next step is getting the PWM working, and building my power circuit. I don't think those should be too difficult.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply