Pages: [1]   Go Down
Author Topic: Op Amps affecting ISP using attiny84  (Read 1027 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using an UNO as an ISP to program an attiny84 on a PCB I made. I'm able to program it when two op amps aren't connected to the SCK and MISO pins, but when I solder the op amps to the board, it says "programmer not responding"

I'm confused because I made the same circuit on a breadboard and the programming worked fine. Any ideas on why it's not working on the PCB? Also, what would be the solution so that I'm still able to use ISP to program the attiny84?

Here's the schematic:

https://plus.google.com/u/0/photos/112970352885170654279/albums/5734988209816271265/5734988211154316818

Thanks!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12744
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


When programming, put 220 ohm series resistors on the ISP lines (MISO, MOSI, SCK) to protect your Uno.

When programming, are the op-amps powered?


Edit: grammatical correction.
« Last Edit: April 25, 2012, 01:50:14 pm by Coding Badly » Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Place series resistors like this?

https://plus.google.com/u/0/photos/112970352885170654279/albums/5734988209816271265/5735102165515747890

And yes the op amps are powered during programming. The UNO provides a 5V supply when I connect it to the PCB, and that supply reaches all of the components due to the power and ground planes.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12744
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Place series resistors like this?

Yes.  (The one on RESET is not really necessary but won't hurt anything being there.)

Quote
And yes the op amps are powered during programming.

I know nothing about op-amps but I assume they are driving the lines to some voltage between GND and VCC.  If they are that would certainly cause problems.
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Two questions then:

1. Why would it work on the breadboard and not the PCB?

2. How else would you do in-system programming? Provide power only to the microcontroller during programming?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12744
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1. Why would it work on the breadboard and not the PCB?

I have no idea.

Quote
2. How else would you do in-system programming?

These are the strategies I'm aware of...

• Only connect "SPI safe" peripherals.  For example, a simple LED (and series resistor) connected to any of the SPI lines causes no problems (and provides nice feedback).

• Use isolation.  For example, I've used a "bus switch" to isolate the target during programming.

• Disable connected devices during reset.  This is a common technique for I2C and SPI devices.  RESET is connected to everything that could affect or be affected by programming.  When RESET is asserted, all the peripheral devices are disabled allowing the target to be safely programmed.

Quote
Provide power only to the microcontroller during programming?

For the peripherals that would tolerate that it is certainly a good option.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BAD! The OPs always drive the lines they are connected to. Why it works on breadboard? Maybe higher impedance on the collections that allows the SPI to drive the microcontroller inputs enough to register the programming, no idea otherwise.
Having resistors on the ISP interface only will not help you. You need the ISP and the microcontroller to drive the pins more strongly than the OPs, so you need some resistance between the OPs and the ISP. Keep in mind that resistors on analog lines might induce a noticable voltage drop, but since µCs commonly read 10k pots (whose maximum output impedance is 2.5k), it should be well if you use resistors in the range between (just an educated guess here) 220 and 4k7 Ohms. Between the OPs and the controller, that is.
Also, should you not include some sort of resistor divider between +5V and GND to put some DC bias on the OPs' inputs? And for that matter, a voltage higher than GND on the inverting amplifier's non-inverting input - because otherwise, it will not amplify well.
« Last Edit: April 25, 2012, 01:53:52 pm by Fat D » Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, should you not include some sort of resistor divider between +5V and GND to put some DC bias on the OPs' inputs? And for that matter, a voltage higher than GND on the inverting amplifier's non-inverting input - because otherwise, it will not amplify well.

The input signal from the MIC is both positive and negative, so I'm using two OPs (one inverting and one non-inverting) to amplify the positive and negative "halves" of the signal. Then, I sum them in the microcontroller.

Quote
Why it works on breadboard?

I attempted the breadboard again and it didn't work (no idea what I did last time when it worked). I continued experimenting by placing a 10k pot on each SPI line and discovered that when any of the SPI pins are at ground or +5V, the programming doesn't work. But anything in between, everything works fine. If that holds true, then with no input, the non-inverting OP is holding the USCK line at ground which could be the issue. Thoughts on that?

Quote
use resistors in the range between (just an educated guess here) 220 and 4k7 Ohms. Between the OPs and the controller, that is

You mean like this:

https://plus.google.com/u/0/photos/112970352885170654279/albums/5734988209816271265/5735484368544092146
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, should you not include some sort of resistor divider between +5V and GND to put some DC bias on the OPs' inputs? And for that matter, a voltage higher than GND on the inverting amplifier's non-inverting input - because otherwise, it will not amplify well.

The input signal from the MIC is both positive and negative, so I'm using two OPs (one inverting and one non-inverting) to amplify the positive and negative "halves" of the signal. Then, I sum them in the microcontroller.

Quote
Why it works on breadboard?

I attempted the breadboard again and it didn't work (no idea what I did last time when it worked). I continued experimenting by placing a 10k pot on each SPI line and discovered that when any of the SPI pins are at ground or +5V, the programming doesn't work. But anything in between, everything works fine. If that holds true, then with no input, the non-inverting OP is holding the USCK line at ground which could be the issue. Thoughts on that?

Quote
use resistors in the range between (just an educated guess here) 220 and 4k7 Ohms. Between the OPs and the controller, that is

You mean like this:

https://plus.google.com/u/0/photos/112970352885170654279/albums/5734988209816271265/5735484368544092146
Yep, the resistors go right there.
I wonder though, is there a reason you are using different amplifiers for each half-wave? As I said, with a DC bias, you could get the full wave through one amp and detect it with a single ADC channel. One difficulty might be increased high-pass frequency, but the right choice of resistors should offset that. Your system as it is is a bit non-linear actually. The non-inverting amp has a gain of 11, the inverting one a gain of 10.
And driving an op-amp input with a voltage of less than its low supply voltage might actually result in undefined behavior. The OP should pull the differential input voltage to almost zero, yes, but there still has to be a minuscule tad of voltage between the input pins, meaning the inverting input still has a voltage below GND. Have you checked the datasheet whether the amp still works? Have you tested the circuit?
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm building off of someone else's previous work...two OPs were used originally and everything worked well so I wanted to stick with that. As for the non-linearity, I realized that and I took care of it in programming.

The circuit works great as is. The ISP is the issue at the moment. I experimented by placing the 220 ohm resistors as you suggested (at the output of the OPs prior to the ISP lines), and the programming seems to be working quite well.

Your help is greatly appreciated. If I have further questions, I'll surely be back.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33328
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using two op amps like this is plane stupid, why copy an idiot?

If your op amps are driving the inputs negitave then you will damage your arduino.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mike, most OPs will not output a logic significantly lower than their negative supply voltage, which happens to be GND in this case. Yes, it would be dangerously stupid to do it with a dual supply, but with a single voltage supply, it is just bad design.
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay so how exactly would I go about using a simple OP? I was experimenting by replacing the very first 10k to 5V with a pot, but that distorted the signal.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33328
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use this arrangement to get the audio into an arduino:-

* Audio Input.pdf (21.66 KB - downloaded 20 times.)
Logged

Pages: [1]   Go Up
Jump to: