NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » Yellow USB wire problem

June 24, 2011
by Ralphxyz
Ralphxyz's Avatar

Noter had said when I had mentioned the problem I and others have had with the yellow USB wire keeping the mcu energized when switching between Programming and Run mode and vice versa in another thread.

[quote] "You can use 2N7000 mosfet transistors for Q1 and Q2 to eliminate that yellow wire problem. [/quote]

Let's start at the beginning.

The problem is that once the yellow wire gets energized it maintains power to the mcu even when the normal power to the voltage regulator is discontinued (turned off).

I have a green LED on the green USB wire and a Yellow LED on the yellow USB wire as suggested by Mongo so I can see when they are energized.

Starting with the Nerdkit not energized (off) the green and yellow LEDs are off.

With the Nerdkit energized the green LED is lit (in programming mode or run mode)!

In programming mode when "make" is typed the yellow LED lights!

Now here is the problem. When the Nerdkit is turned off after loading a program in order to run the program by switching the programming switch to run and re-energizing the Nerdkit the yellow LED is still lit!

With the Nerdkit turned off there is still > 2 volts on the rails!

With the Nerdkit energized and the programming switch in run mode the program runs!

When you want to load a new program or revision you turn off the Nerdkit and switch the programming switch to programming.

Because the mcu is never de-energised it does not enter programming mode when the Nerdkit is energized in programming mode. The mcu thinks it is still in run mode.

In order to enter programming mode the yellow wire has to be de-energized by pulling the usb plug from your PC or as suggested by Humberto placing a switch on the yellow wire.

Now how does Noter's solution using two 2N700 MOSFET transistors solve the problem?

I assume Q1 and Q2 make some sort of latch that is interrupted (opened) when power is lost at 5V.

Why wouldn't just a single transistor act as a switch?


Paul I would like your Eagle schematic, of course I would change it to add the green and yellow LEDs and eliminate the LCD wiring as I am trying to use Rick's I2C LCD project.

It should be noted that not everyone has this problem!! I use a Mac with OS X. I do not remember if I have this problem with my Windows pc.

Back to the start of this thread and using a reset button. Using a reset button seems to have eliminated the problem so I might not need Noters fix but I am curious how it works so I started this thread in Electronics.

Ralph

June 24, 2011
by 6ofhalfdozen
6ofhalfdozen's Avatar

Ralph,

I have that issue on both my XP and Vista machines. In the end, it ended up being easier to unplug the USB and power cycle, rather then drive myself nuts trying to figure it out.. evil yellow wires.... who knew?? they look harmless enough, don't they??

June 24, 2011
by Rick_S
Rick_S's Avatar

Ralph, I must assume that neither your mac mini or PC have a true serial port on them. Have you ever tried a different USB to serial adapter with and inverter like the kit came with in days gone by? Maybe one with a chipset other than the prolific on supplied by the NK guys. Possibly an FT232 based board like the one Here that Sparkfun sells.

It seems that the computer is leaving the prolific chip in this cable at a high state after sending data. Maybe a different chipset in a board that was designed around communication with the micro's would work differently than the NK cable in your setup??

I assume the NK cables are some data cable (Maybe for a cell phone) they chop the end off of and tin the wires. I don't have one though, when I bought my kit it came with a USB-Serial adapter with a small inverter breakout board for connecting to the micro (like on page 35 of the current NK guide). I'm guessing the modified cables save them a lot of money over the other method.

Rick

June 24, 2011
by Rick_S
Rick_S's Avatar

One last thing about the FT232 chipset, it is used on an arduino clone I have. I have loaded an NK bootloader chip on that board and loaded programs fine using the reset button and programming switch I always set up. So you might think about giving it a try.

Rick

June 24, 2011
by Noter
Noter's Avatar

A single transistor circuit inverts the signal so the 2nd one inverts it back to the original polarity. That's the only reason for two transistors. It's two invertors in a row.

The voltage on the yellow wire can turn on the 1st transistor but that's it. No voltage or current leaks thru so when you turn off the power to your breadboard everything goes off as expected. So after power off if you measure the voltage on the yellow wire it is 3.5 volts or something like that but your rail will be 0 volts as expected so the Atmega will really be completly powered off.

I had the same issue as others with voltage on the yellow wire. I set my brown out dectector fuse values for reset below 4.5 volts so it was no longer an issue for programming/running but I still didn't like power on the rail when it was supposed to be off. I had an idea this might work and finally got around to testing it the other day and found it works well.

June 24, 2011
by Noter
Noter's Avatar

I use an FT232 on one of my boards too and it works fine. I just checked and it doesn't leave voltage on either of the serial wires like the nerdkit cable does.

June 24, 2011
by Ralphxyz
Ralphxyz's Avatar

6ofhalfdozen, I have been using a DPDT (Double Poll Double Throw you could use a single throw switch if you can find one) switch on the yellow and red wires it saves on pulling the USB plug and getting those nagging notices that I had unplug something. OS X does not have a method to turn off a USB device like windows does so it nags me everythime I unplug the USB.

Also on my Mac using a reset button is working.

Thanks Rick, I do have a serial port on my Windows pc maybe I could make up Noters RS232 circuit of course once agin I need the Eagle schematic.

Well that one might be a good one to start learning Eagle with I can use a Picture of Paul's circuit and make up my own schematic.

Yeah Paul, I do not like the rails being hot or even luke warm when I turn the power off.

So I like the Mosfets, Thanks once again.

Ralph

June 24, 2011
by Noter
Noter's Avatar

I don't have an eagle schematic for the RS232 convertor. I just found it somewhere on the internet and tried it and liked it. You should have an eagle schematic of the basic nerdkit with the I2C eeprom memory project. All I did for this one was replace the I2C eeprom with the MOSFET's. Eagle is not so hard once you start using it and get a little practice under your belt.

November 04, 2011
by treymd
treymd's Avatar

This thread has saved me a few more hours of frustration and an uneeded new thread. After some time away from my nerdkit, I have gotten back into it, and rewired a small project board complete with an LED that is connected directly to the rails with a current limiting resistor. The positive rail is turned on and off with the SPST nerdkit switch. I plugged it all in and regardless of how I powered the board, once the USB to UART-TTL cable was plugged in the power indicating LED would light dimly until the power switch was turned on, and then it would go to full brightness. I suspected something was up with the UART, and nearly tossed a poor little 168 in the trash out of frustration. Am I to understand that power is indeed leaking to the positive rail from the TTL cable through the yellow wire? Does this have any long term negative effects on the MCU itself?

November 05, 2011
by Ralphxyz
Ralphxyz's Avatar

treymd asked?

Am I to understand that power is indeed leaking to the positive rail from the TTL cable through the yellow wire?

Short answer, YES definitely there is constantly power leaking to the positive rail.

Does this have any long term negative effects on the MCU itself?

That would be hard for the average user to define.

But I used to blow a mcu every month for my first year, I have not blown any lately since I started using a switch on the yellow wire.

I do not know what caused any of the blowouts or if the yellow wire power contributed.

I never did get Noter's circuit to work, so I use a DPDT (double pole double throw ) switch on the yellow and green wire.

The most immediate problem is not being able to load new programs when the mcu is in it's zombie state.

Ralph

November 06, 2011
by BobaMosfet
BobaMosfet's Avatar

I haven't seen all of this, so I'm somewhat in the middle of this. With that said, if all you're wanting to do is provide power from USB to the NerdKit, then you only connect pins 1 and 4, not 2 & 3.

BM

November 09, 2011
by Ralphxyz
Ralphxyz's Avatar

BM, the "problem" is not with wanting to supply power from the USB but that there is constant voltage on the yellow wire that energizes the bus and keeps the mcu in a zombie state.

Specifically this causes a problem on Apple MAC computers.

There is a whole lot of discussions about this on the Nerdkit forum.

My solution is to use a switch on the yellow wire.

Ralph

November 09, 2011
by BobaMosfet
BobaMosfet's Avatar

Ralphxyz-

Thanks for the clarification- I went and took a look at the other threads.

I'm going to let you in on a little secret. You can power the ATMEGA168 on any pin- in fact many mcus can be powered this way, because the pins are designed to dump excess voltage to the rails.

This is why, when power is removed from the voltage regulator, the chip is still powered.

The solutions you and Noter have come up with will solve the problem.

BM

November 19, 2011
by BStory
BStory's Avatar

The 2 mosfet trick did the.... trick. Thanks a bunch!

November 22, 2011
by Ralphxyz
Ralphxyz's Avatar

BStory, did you change your name?

Didn't you used to be someone else?

Damm, here we go off topic, but it seems like I've seen your picture before.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that NerdKits believes in the importance of a mixture of meaningful topics, clear instruction, and engaging projects? Learn more...