Show Posts
Pages: [1] 2 3
1  Using Arduino / Networking, Protocols, and Devices / Re: Serial to USB interface using the FT232 on: March 24, 2013, 10:31:32 am
Great, thanks!

(Since this will be used for isolated communication, I'll only need to isolate two signals which is a relief smiley-wink)
2  Using Arduino / Networking, Protocols, and Devices / Re: Serial to USB interface using the FT232 on: March 23, 2013, 02:52:33 pm
What happens if I let's say just send out some sensed data over Serial without checking if the USB is connected and at some point connect the USB and open a Serial monitor. Would I need to manually reset the AtMega or will the PC be able to pick up data from the moment on, when it was connected without having to reset the AtMega?
3  Using Arduino / Networking, Protocols, and Devices / Serial to USB interface using the FT232 on: March 23, 2013, 11:36:25 am
Hi,

for a project I'm trying to build a completely isolated serial to usb interface using the FT232. Since the Duemillanove used to use this chip, I looked into it's schematic to figure out what connections I'll need. I thought that I would only need the RX and TX pins on the AtMega328 to connect to the FT232, but the Duemillanove also connects to other pins of the FT232. Are these only required to be able to program and reset the µC(I don't need that for this circuit) or do I also need more than RX/TX?

Thanks!
4  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 13, 2012, 07:41:18 pm
What about your code and setup?
5  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 13, 2012, 08:44:34 am
When you are done, come back and we can compare notes then.

You know the schematic, and the code is pretty easy
Code:
ISR(TIMER2_COMPA_vect){                        // every 500µs
  bitWrite(PORTD, 3, 0);                          // Disable discharge
  bitWrite(PORTD, measurementRange, 0); // Pulse
  delayMicroseconds(7);                           // The pulse width should be around 8µs
  bitWrite(PORTD, measurementRange, 1); // Stops the pulse
  bitWrite(PORTD, 3, 1);                         // Enable discharge
}

ISR(ANALOG_COMP_vect){ // Comparator interrupt
  compareCounter++;
}

In the lowest range, every pulse is 10mΩ. In the middle range 100mΩ and 1Ω in the high range.
6  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 13, 2012, 07:17:43 am
I am concerned that the atmega328p datasheet provides (as far as I can tell) no data on the speed of the analog comparator, so there is no telling whether it is fast enough for this application.
I was concerned about that as well, but I'll try and report back.

As far as the circuit itself is concerned, I understand how it works and will use a similar setup. I know there are other ways with less hardware but this project is not intended for sale or anything, mainly just to use Atmega328 features I haven't used before(like the comparator) and understand how they work. And to have a working ESR-meter in the end smiley-wink

@dhenry
I'd be interested in the code and schematic as well, but I'll implement it the other way.
7  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 12, 2012, 05:38:17 am
You can do the whole thing with PWM.

Yes, but I need to switch the pulse between three pins to change the range for my measurement. That would only be possible with software PWM, right?
8  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 11, 2012, 06:59:54 am
Yes, you can call it inside an ISR. However, inside an ISR you should use it only for short delays, because you are lengthening the tie it takes to complete the ISR and hence the time before other interrupts can be serviced.
Ok, thanks! The interrupt will be executed every 500µs and inside it will only be one delayMicroseconds() of around 10µs and the whole routine should take no longer than 15µs, including the delay.
9  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 11, 2012, 06:09:26 am
You could call delayMicroseconds instead, but I'm not sure what the minimum delay you can get with it is.
On the Arduino website, it says around 3µs. But can I call it inside a timer interrupt?

Quote
This function works very accurately in the range 3 microseconds and up. We cannot assure that delayMicroseconds will perform precisely for smaller delay-times.
10  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 11, 2012, 04:34:52 am
I have another question on timing inside an interrupt. Currently a
Code:
bitWrite(PORTD, measurementRange, 0);
is just called multiple times inside a timer interrupt to make a pulse with a width of somewhere between 4µs and 15µs(adjustable) because i read here http://jeelabs.org/2010/01/06/pin-io-performance/ that it takes about 1µs to execute a bitWrite(). Is there a better way for such short timings? It doesn't have to be that precise, just the same amount of delay every time once it's set.
11  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 10, 2012, 04:05:53 am
Somewhere I heard, that interrupts aren't allowed within interrupts. Is that true? If the Arduino "remembers" that there was another(different) interrupt during the timer interrupt and executes it afterwards, that would be fine ...

It wouldn't work very well if it could only handle one interrupt source at a time. Yes it will remember interrupt events. The ISR will not be entered until the current one completes, and one more instruction is executed. Then the highest priority outstanding interrupt (if any) will be serviced.

http://www.gammon.com.au/interrupts
Thanks!
12  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 09, 2012, 09:02:52 pm
Somehow I knew that I shouldn't have said what I'm building because there is always someone who just wants to argue instead of helping someone.
Btw, the Meter has been sold tens on thousands of times (as a kit and prebuild) and is still being sold, so the method of "indication" can't be too wrong.
13  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 09, 2012, 08:22:16 pm
The comparator(and C10) is essentially there for an extremely fast analogRead(), which otherwise wouldn't be possible fast enough.
The goal of an ESR meter is to make measurements in circuit possible and if you charge the capacitor you'd activate other stuff in there.
http://en.wikipedia.org/wiki/Equivalent_series_resistance

If you know V, n, I, Tc, Td, C, you can solve for ESR from the above.
Where should the µC know C from? I don't want to enter it every time.

Anyhow, can I improve my software solution or do I require two interrupts, without changes to the way the measurement is done?
14  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 09, 2012, 05:19:27 pm
I assume that you aren't using a bridge here.

The typical approach then is to charge up a fully depleted cap and measure the current during the initial charge up. The comparator is probably not a very good tool for this.

Unless you have a different approach?

I feed the DUT with a constant current(chopped by the generated pulse), amplify the generated voltage over the DUT and compare it to the voltage of a reference cap that is being charged by a constant current(==> linear rising voltage). If you want to read more, here's a link: http://members.ozemail.com.au/~bobpar/k7214.pdf I basically just added some stuff I wanted and converted it to be Arduino based.

But my question was if you know a better way with only one interrupt smiley-wink
15  Using Arduino / Programming Questions / Re: Analog Comparator falling edge setup on: December 09, 2012, 04:41:07 pm
So the timer will trigger an external device to create a voltage which the analog comparator is going to compare against?

What does the whole thing do?

Measure the ESR of a cap
Pages: [1] 2 3