Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Troubleshooting / Re: tx pin active while loading program on: August 21, 2008, 01:18:06 am
Quote
Quote
the tx pin seems to echo out what is coming in over usb.
The data sent over USB "goes into" the TX/RX pins of the device.

--Phil.

Understood - sorta smiley

I thought that the usb data would be coming in the rx.

It seems like it is getting echo'd out the tx.

Thanks for the reply, btw.

2  Forum 2005-2010 (read only) / Troubleshooting / tx pin active while loading program on: August 21, 2008, 12:37:56 am
Hi,

When I load my program into the arduino by:

1. ) pressing reset on aurdino ng
2.) pressing "upload to i/o board" in software

the tx pin seems to echo out what is coming in over usb.

Is it possible to stop this? I have the tx pin connected to external components and they do
not like the random data sent to them.

Currently I have to unplug the tx pin while uploading a new program.

Any ideas or advice?

Thanks.
3  Forum 2005-2010 (read only) / Syntax & Programs / microsecond interrupt? on: October 28, 2007, 09:02:23 pm
Hi,

Is it possible to set an interrupt to go off every x number of microseconds? I've searched some and not found anything.

Or is there anyway to get something like a millis() function for micros? Right now I use 2 calls to millis and subtract the difference to get an approx microsend count.

Thanks.
4  Forum 2005-2010 (read only) / Syntax & Programs / do i need an interupt and/or timer? on: September 07, 2008, 12:52:34 am
Hi,

I've been writing various midi sequencers on the arduino. To those unfamiliar with a midi sequencer, it
sends a value to the serial tx after every set period of time. For instance 120 times per minute (120 bpm).

Currently I do something like:

loop()
{

   // check if needed time has passed, if so send the next step of the sequence
  
  // check for button presses etc.
}


the main problem i see is that the checking of passed time is all done inside the main loop. as i add code to check various buttons, pots, etc. i am afraid it could affect the accuracy of the timing.

i have enough familiarity with the concept of interrupts that i'm wondering if i'd be better off to install an interrupt that goes off every x milliseconds and runs the code that sends the next value in the sequence.

Is this the best way to do this? Is it possible with the arduino?

my current code is :

Code:

extern volatile unsigned long timer0_overflow_count;

unsigned long hpticks (void)
{
    return (timer0_overflow_count << 8) + TCNT0;
}


void loop() {
  
  int t1, t2;
  
  
  t1 = hpticks() * 4;
  t2 = hpticks() * 4;
  
  
  while (1) {
    if ((t2 - t1) >= pulse_interval) {
        process_pulse();
        t1 = hpticks() * 4;
    }
    t2 = hpticks() * 4;
  }

}



The code is stuff I found in other peoples examples of how to get more accrute time than milis(). I think I'm most of the way there.

All advice appreciated.



5  Forum 2005-2010 (read only) / Syntax & Programs / playing wav files on: November 02, 2007, 10:03:00 am
I know this is not really what a microcontroller is for but...

Would this work:

convert a small wav file to an array of 8 bit ints
embed that array into an arduino program which sends the values out
via a function like freq_out()

http://www.arduino.cc/playground/Main/Freqout

I would just try it myself but it's turning out to be harder than I thought to find something to create
the int array so I figured I'd ask if anyone thinks this would work before I go to all the trouble of likely
writing a little program to do the conversion for me.

Thanks.
6  Forum 2005-2010 (read only) / Development / audio input and output on: November 11, 2007, 08:48:14 pm
[I realize that a micro-controller is not meant for audio processing]

I've wrote a simple program to do an analogRead and then pass that value to analogWrite. I expected to get a lo-fi version of input. I also tried to first divide the analogRead value by 4 to keep in in the range of values that analogWrite can output.

Neither gives me what I expect.

I get a lot of noise and a constant tone through-out.

Should this be working?

7  Forum 2005-2010 (read only) / Troubleshooting / verification error on: August 24, 2008, 11:38:03 pm
Hello,

I believe I have a problem similiar to this one:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1215617395/0#0

In short, the arduino continues to run the last sketch uploaded but will not load new ones, I get:

avrdude: verification error, first mismatch at byte 0x0000
         0x39 != 0x00
avrdude: verification error; content mismatch

Is there anyway to recover this without an avr programmer to reload?

Thanks.
8  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: November 09, 2007, 01:08:09 am
Also, can anyone confirm that a 4n37 should work the same as the 4n28. They appear to have the same pinout:

http://rocky.digikey.com/WebLib/Lite-on/Web%20Data/4N35(37).pdf

I just cannot seem to get this to work. smiley-sad

9  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: November 09, 2007, 12:57:55 am
Can you confirm that the diode is not strictly needed. My understanding is that it is to protect the photocoupler from accidental reverse voltage.

I'm having trouble with the circuit and am trying to make things as simple as possible. Ie. midi pin 4 directly to 220 res to pin 1 and midi pin 5 directly to pin 2.

Thanks.

10  Forum 2005-2010 (read only) / Interfacing / which shift register to buy? on: October 02, 2008, 12:39:24 pm
Hello,

Is there a general purpose shift register that you would recommend to have on hand for multiple purposes.

I want to:

control multiple LED's with few pins
read multiple switches/buttons with few pins

I believe a shift register is what I need (or multiplexer). Is there a "standard" one I should buy a few of (sorta like how the 555 timer is a standard part to have a few of for various purposes).

Thanks.
11  Forum 2005-2010 (read only) / Interfacing / Re: what type pot to use for digital input on: October 02, 2008, 01:54:50 pm
Sorry, yes. I meant analog input - basically where i do not care about the electrical properties. I just want to use it to step through values.
12  Forum 2005-2010 (read only) / Interfacing / what type pot to use for digital input on: October 02, 2008, 12:40:56 pm
Hi,

When using a pot for digital input, what value should I buy?

I have several random ones that I use now and just adjust my code to give a good range. I'm looking to standardize on a particular type.

Suggestions?

Thanks.
13  Forum 2005-2010 (read only) / Interfacing / Re: more ram on: September 08, 2008, 07:06:30 pm
Quote
hmm, sampling audio data with the arduino, it was my understanding that the arduino was too slow to be of any use with audio other than volume levels.

I had been told that too but luckily it works very well. I'm only doing doing 8bit 8k but it sounds decent.

14  Forum 2005-2010 (read only) / Interfacing / Re: more ram on: September 07, 2008, 04:07:12 am
Quote
People have interfaced both USB memory sticks and SD cards to Arduino. This might be your solution, depending on how fast you need to sample and store data.

The obvious and simple solution wold be to send data over serial to a PC, but i assume that you need a stand alone device ?

Thanks for the reply.

Yes, it is a stand-alone device.

I've considered usb memory sticks or sd. I'm not sure how fast those can write.

I'm sampling audio data at 8000 times a second. Not sure if those could keep up? Also, I'd be afraid I would soon reach the re-write limit (they are similiar too eeprom in that they can only be overwrote a certain number or times?)

I suppose I should learn to program dsp chips instead of trying to make the arduino do these tasks!
15  Forum 2005-2010 (read only) / Interfacing / more ram on: September 07, 2008, 02:40:49 am
Hello,

What are my options (if any) if I need to add more ram?

I'm sampling some incoming data (8 bit values) and run out of space very quickly.

I've considered the Sanguino but even 4k would likely be too little. I would imagine I'd need 10-16k.

Thanks for all advice!

Pages: [1] 2