Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Making a standalone polargraph w/ MicroSD
zenwebb
Newbie
Posts: 3
Permalink
Post Making a standalone polargraph w/ MicroSD
on: January 14, 2012, 20:23
Quote

I'm hoping to build my own polargraph over the next couple months and install it in a public place at my university (just for fun, really). Ideally, I'd like to remove the PC from the equation, because getting a PC at my university is remarkably difficult 😛

I was thinking about implementing a MicroSD breakout board from Adafruit into my project, and using it to store all of the commands that would be generated by the Processing server application. In other words, I was thinking to modify the Processing app to write all of it's serial commands to a text file instead of transmitting them to the polargraph, then load that text file onto a MicroSD card. Instead of relying on commands from the serial connection, the Arduino would instead be streaming the commands from the SD card.

I was curious if this thought had occurred to anyone else, and if any attempts have been made already? I've already identified a problem in that the MicroSD breakout and the Adafruit motor shield share the SPI pins, so it may not be possible 🙁

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Making a standalone polargraph w/ MicroSD
on: January 14, 2012, 22:34
Quote

Definitely possible, and on my list of things to do. It isn't even very hard actually, the controller can already export the queue as a text file. And there's no reason why the server couldn't go into "buffering" mode where it stores the instructions away on the card instead of executing them directly.

I wrote about trying to get this working, and the SPI / motorshield issue on http://forums.adafruit.com/viewtopic.php?f=31&t=22422&p=117621#p117621, a wee hack, but more or less functional I think. This was before I was really using the servo though, and it did cause a problem with the servo, so it might not be completely practical if you require a pen lift.

The real issue is that the libraries that are needed to usefully access the SD card as a drive are pretty big, and memory is already tight on a regular ATMEGA328. I stripped it back to the minimum required to read only from a sd card using a proprietary file allocation format, and it would compile and start ok, but it was pretty close to blowing the stack almost continually, and frequently did. Let me know if you're interested and I'll dig the code out and put it back into the repository in some form.

For standalone drawing, I really think something bigger than a regular arduino is required, so I was eventually using an arduino Mega - actually a DFRobot clone. The SPI interface is on a different set of pins on the mega, so the motorshield no longer inteferes with them.

I never actually got round to using it in anger, since I got sidetracked with the kitting projects, and it needs extra things like buttons to be useful. But I intend eventually to offer the core code as a library, and have a reduced firmware version for regular arduinos (ie the code as it stands now), and an advanced firmware version that will be a bit more clever and do stuff like reading/writing commands from file, and even reading / writing images directly so it can do stuff like work off a camera without having to have a computer attached. Not sure how feasible that is, but have been looking into it.

Cheers
Sandy Noble

AAlex
Newbie
Posts: 5
Permalink
Post Re: Making a standalone polargraph w/ MicroSD
on: January 15, 2012, 17:45
Quote

Couldn't the SPI problem be solved using an attiny just to control the pen lift?
I've never used the attiny but i think that maybe with a digitalpin will be possilbe to chose two servo position....

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Making a standalone polargraph w/ MicroSD
on: January 15, 2012, 19:38
Quote

Sure, don't see why not, if it's equipped to run the servo (spare PWM pin).

I think there still might be a way to do it, but I admit I stopped looking for it once I realised the SD card library wasn't going to fit into the memory on the ATMEGA328 anyway.

zenwebb
Newbie
Posts: 3
Permalink
Post Re: Making a standalone polargraph w/ MicroSD
on: January 15, 2012, 23:01
Quote

This is quite a good suggestion, and definitely worth pursuing in the future. An ATTiny85 has 2 hardware PWM pins, and can handle another one or two PWM signals via software PWM. Once I've worked out my own implementation of the software, I'll take a closer look at doing this!

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.041 seconds.