V-USB and Attiny85

Go To Last Post
51 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am trying to implement a simple USB interface using ATTINY85. I know USB is not natively supported for this chip, but V-USB claims to do this at the software level. Although I can get their example codes to compile and flash the chip without any trouble, the interface is not being recognized when plugged into Windows 10.  I have checked my clock on an oscilloscope and it is within the required specs. I would have posted this question on V-USB forum, but most of the discussions there seem to be circa 2010, more than 10 years ago. I am not sure if there is a better way to implement USB interfaces on these chips. Any suggestions?

 

This topic has a solution.
Last Edited: Sat. Jun 27, 2020 - 04:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is a while since my last V-USB+Tiny85 but I can assure you that it worked with earlier versions of Windows.  I have not tried with W10 as I don't have it... and probably never will. Can you try with an earlier version of windows?

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can get their example codes to compile and flash the chip

Which codes?  There have been various over the years. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The one I compiled was Easylogger, which seems to be the code the majority of people were using as a starting point. I also wrote my own. My clock is 16.535MHz (which is well within the 1% margin of 16.5MHz). All of these failed when I plug into Windows 10 with "Device not recognized". Not even the vendor id is passing through. I saw two other posters mentioning this as well. One person said they got it to work using a USB 2.0 adapter.  There doesn't seem to be any activity in the V-USB forums, or even a way to sign up as a poster. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an old board here with V-USB and a win10 PC and that code works.

No warnings on plugging it in and when I pressed the start recording button it started spitting out data to an excell sheet right away.

So V-USB and Win-10 should be good to go.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

asarangan wrote:
I am trying to implement a simple USB interface using ATTINY85.

I've never known USB to be simple, can you show us a picture of your hardware, hopefully you are not trying to do this on a breadboard!

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

ki0bk wrote:
I've never known USB to be simple

+1

 

For a really simple USB connection to a host, just use one of these:

 

  

and wire it straight to the microcontroller's UART.

 

Job done.

 

cool

 

edit

 

image

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jun 22, 2020 - 01:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
and wire it straight to the microcontroller's UART.

Only a T85 doesn't have a USART!  but yes that is the easy solution for AVR's with a USART.

 

V-USB was made when USB was v1.1, since then USB has changed, v2, v3, etc....  The hardware has changed as well, requiring pull up/ pull down resistors to tell the host what the slave can support.  That is why I asked about the hardware, does it have the required PU, PD resistors to slow the bus down to v1.1 speeds supported by V-USB. 

 

Jim

edit: for low speed mode (most likely the only mode supported by v-USB), a 1.5k pull up resistor is needed on the D- line only.

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

Last Edited: Mon. Jun 22, 2020 - 02:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "simplest" way to do USB is to actually pick a chip that contains a USB peripheral (so you don't have to tie up most of the CPU resources to "fake it"!) I wonder what the particular attraction of the tiny85 is? I suppose it's true that Atmel simply don't do a chip that has USB with DIP package so perhaps you are drawn to tiny85 simply because it is small and DIP package? If you can handle surface mount (ie make your own PCB or use a "carrier") then there are some smallish AVRs with USB. (8U2 comes to mind).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
Only a T85 doesn't have a USART!

Oops.

 

blush

 

But still easier to bit-bang a UART than USB, I think?

 

clawson wrote:
The "simplest" way to do USB is to actually pick a chip that contains a USB peripheral

But you still have to have the software "stack" to drive it - so I think a UART is still simpler?

 

Atmel simply don't do a chip that has USB with DIP package

I think there are some PICs in DIP with USB ?

 

 

ADDENDUM

 

AN_0941 - AVR304: Half Duplex Interrupt Driven Software UART on tinyAVR and megaAVR devices

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jun 22, 2020 - 02:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

I think there are some PICs in DIP with USB ?

 

Lots.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
But you still have to have the software "stack" to drive it -
Yeah but Dean wrote that so no one else ever has to ! cheeky

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dean wrote that 

Why did Dean give up on the 'freaks, or has he? Maybe he got tired of datasheet errors. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am still having no luck.  I have reconnected the circuits several times. I am using two 1.75V zeners in series to get 3.5V I am not sure if that is a problem or not, but it is well within the spec. I am measuring 3.48V with an oscilloscope. The crcuit is exactly as depicted in the EasyLogger. I also tried the hid-mouse code. The result is the same - ie., I can compile and flash just fine, but no connection to Windows10. 

 

1. I have checked the fuse byte, and they are exactly as specified in the documentation (0xDD and 0xE1)

2. I calibrated the clock by modifying OSCCAL

3. I have verified that the clock is well within the 1% tolerance of 16.5MHz using an oscilloscope

4. The circuit has been double and triple checked. I even swapped the D+ and D- wires on the USB cable just in case their colors were reverse (I am using Green=D+ and White=D-)

5. There is a 2.2k pullup resistor on the D- line

6. 68 ohms series resistors on the D+ and D- lines

7. Voltage levels on the D+ and D- are 3.48 volts

 

 

I would like to check the waveform on the D+ and D- lines, but I see no activity. D- line is sitting at 3.48V and D+ line is at 0V. As soon as I plug the USB into the host, I see some pulses in the D- line, but nothing on D+. I am not sure what  signal waveforms are supposed to be there in order to diagnose further.

 

Any clues or suggestions would be appreciated.

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:
The crcuit is exactly as depicted in the EasyLogger.

Link please

 

Can you post a picture of your setup?

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


This one?

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens if you plug into a win7 machine, or at least a different PC?  Does it work then?

 

the interface is not being recognized when plugged into Windows 10. 

Does anything at all show up in the device manager?   I used to have some USB serial cables that were "dead", but at least the manager showed they weren't working (with some cryptic error code/condition).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is the schematic and the photo. Note, I am not using the LED indicator or the start/stop switch for the logging function because my goal is just to get it to connect, not actually to run the intended function of the circuit.

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried a different machine (but still Windows10), but it didn't work. I suspect the problem is at the circuit level. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

 

Does anything at all show up in the device manager?   I used to have some USB serial cables that were "dead", but at least the manager showed they weren't working (with some cryptic error code/condition).

 

Device manager shows "Unknown USB Device (Device Descriptor Request Failed)".

I believe its not communicating at all. In fact, I can unplug the attiny chip from the board altogether, and Device Manager still gives the same message. 

 

Last Edited: Tue. Jun 23, 2020 - 08:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried it on a Linux machine, and this is what I got:

 

[5631133.328254] usb 4-2: new low-speed USB device number 14 using uhci_hcd
[5631133.642230] usb 4-2: device descriptor read/64, error -71
[5631133.856242] usb 4-2: device descriptor read/64, error -71
[5631134.059207] usb 4-2: new low-speed USB device number 15 using uhci_hcd
[5631134.172193] usb 4-2: device descriptor read/64, error -71
[5631134.386177] usb 4-2: device descriptor read/64, error -71
[5631134.487199] usb usb4-port2: attempt power cycle
[5631134.893177] usb 4-2: new low-speed USB device number 16 using uhci_hcd
[5631135.301132] usb 4-2: device not accepting address 16, error -71
[5631135.403109] usb 4-2: new low-speed USB device number 17 using uhci_hcd
[5631135.811068] usb 4-2: device not accepting address 17, error -71
[5631135.811102] usb usb4-port2: unable to enumerate USB device

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So have you googled what that " error -71"  means ?

 

What USB test tools do you have?

 

Again, is this all really worth it?

 

EDIT

 

Recently, on AVRFreaks - a full-duplex soft UART for Tiny85:

 

https://www.avrfreaks.net/forum/full-duplex-software-uart-tiny-avrs

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Jun 23, 2020 - 11:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

So have you googled what that " error -71"  means ?

 

What USB test tools do you have?

 

Again, is this all really worth it?

 

 

I have no other USB test tools, other than an oscilloscope, multimeters etc... 

 

Is it worth it? I won't learn anything by giving up now. Surely, I am missing something simple. I will figure it out, eventually. That's when I will be ready to move on. You can call it obsessive personality.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you looked for descriptions of what actually happens when a USB device is plugged into a host: how it is detected, what negotiations go on, etc, etc ... ?

 

have you tried googling for utilities to monitor the traffic on a USB link?

 

then compare what happens with a wroking device to what happens with your device ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I don't see a 100nF capacitor - only a 10uF electro.

There's 4 diodes - the schematic shows 2 zeners.

 

If you've put two 1N4148 diodes in series, that's not going to work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Russell,

 

In post#14 he says...

I am using two 1.75V zeners in series to get 3.5V I am not sure if that is a problem or not, but it is well within the spec.

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aye. I wonder what the part number is for the zeners then? Zener performance gets worse as the voltage decreases if I remember correctly.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


An alternative configuration is to use a lower supply voltage and eliminate the zeners. Easily evaluated.

 

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I finally got it to work, well sort of. I tried five different computers. One was Windows 7. Two were Linux. Others were Windows 10. None of them worked. Then I tried it on a cheap $100 laptop that I had bought from Walmart. Voila, it worked! I plugged and unplugged multiple times. It worked consistently. No flakiness at all. The laptop is slow, but not that old. It is running Windows 10, and the device driver says USB 3.0. I don't know what the real difference is between that laptop and all the other computers. 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:

I am trying to implement a simple USB interface using ATTINY85. I know USB is not natively supported for this chip, but V-USB claims to do this at the software level. Although I can get their example codes to compile and flash the chip without any trouble, the interface is not being recognized when plugged into Windows 10.  I have checked my clock on an oscilloscope and it is within the required specs. I would have posted this question on V-USB forum, but most of the discussions there seem to be circa 2010, more than 10 years ago. I am not sure if there is a better way to implement USB interfaces on these chips. Any suggestions?

 


.
Windows 10 USB has little different time frame than others version. (that's what I experienced)
.
VUSB version will barely work because the lack of driver.
VUSB can only be USB 1.1 devices. Which I guess Windows 10 don't really support it anymore?
And I guess nobody interested to make the driver one ;P
.
Use HID version of VUSB as it will guaranteed to work on every version of Win10.
There's HID example as data exchange in VUSB.
.
But you better use chips with USB peripheral as it's more reliable to use with Win10.
.
Smith

I don't know why I'm still doing this hobby

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I don't know what the real difference is between that laptop and all the other computers. 

Tell everyone that's why you have built your "cheap laptop detector".  Soon everyone will want to buy one to check their own laptops.  I smell a profit.  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:
I don't know what the real difference is between that laptop and all the other computers. 

I'd guess it's sloppy timing:

 

Probably, your ATtiny's timing is out-of-spec, and the cheap laptop is marginal - so it (just) manages to get close enough to your ATtiny for it to "work".

 

I wonder how reliable it will be ... ?

 

Again, get some USB diagnostic utilities and compare the working & non-working cases.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
Why did Dean give up on the 'freaks, or has he?
Aside: after leaving Atmel he went on to work on Wi-Fi light bulbs which are some kind of ARM design I think. He didn't exactly get on with them though. @abcminiuser on twitter generally gives an idea of what he's up to at any specific time though.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Dean got married and got a real job, so that keeps him pretty busy methinks.

 

I'm currently unemployed at the moment and I have considered applying at where Dean currently works. Problem is he'd probably end up being my manager and I wouldn't want to subject him to that!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
he'd probably end up being my manager and I wouldn't want to subject him to that!
smiley

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

How much bulk capacitance are you allowed to shove into a USB port?  I see two electrolytics on the photo of the breadboard but their values are not visible.

Letting the smoke out since 1978

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

digitalDan wrote:

How much bulk capacitance are you allowed to shove into a USB port?  I see two electrolytics on the photo of the breadboard but their values are not visible.

 

Those are between VCC and ground. one at the USB end, and the other right across the chip, exactly as depicted in the schematic. 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:

I finally got it to work, well sort of. I tried five different computers. One was Windows 7. Two were Linux. Others were Windows 10. None of them worked. Then I tried it on a cheap $100 laptop that I had bought from Walmart. Voila, it worked! I plugged and unplugged multiple times. It worked consistently. No flakiness at all. The laptop is slow, but not that old. It is running Windows 10, and the device driver says USB 3.0. I don't know what the real difference is between that laptop and all the other computers. 

That suggests the hardware matters, and the SW-Only USB instances are not fully USB spec'd, even at 1.5MHz,  so they are a lottery when it comes to hardware passes.

 

Still, you did learn something here :) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:

asarangan wrote:

I finally got it to work, well sort of. I tried five different computers. One was Windows 7. Two were Linux. Others were Windows 10. None of them worked. Then I tried it on a cheap $100 laptop that I had bought from Walmart. Voila, it worked! I plugged and unplugged multiple times. It worked consistently. No flakiness at all. The laptop is slow, but not that old. It is running Windows 10, and the device driver says USB 3.0. I don't know what the real difference is between that laptop and all the other computers. 

That suggests the hardware matters, and the SW-Only USB instances are not fully USB spec'd, even at 1.5MHz,  so they are a lottery when it comes to hardware passes.

 

Still, you did learn something here :) 

 

Actually, its a bit more than that. I did more experimentation and got it to work on all computers. It turns out the problem was with the zeners, not the clock, and not the voltage level. Actually, the device is surprisingly tolerant to variations in supply voltage and clock rates. Getting rid of the zeners and using a 3.3V regulator on the supply line solved the problem. I also got it to work by putting two diodes in series on the supply line. Shunting the D+ and D- with zeners was the main problem. I will dig into this more and post the details later, but I think pulling down a signal line with a zener (even a high speed zener) without limiting resistors on both sides is problematic. It might work if the cable resistance is high enough. 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

So... I guess you could mark post#28 as the solution?

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:

Getting rid of the zeners and using a 3.3V regulator on the supply line solved the problem.

 

 

Zeners are not a good choice in such applications for several reasons...

 

1) At low current they start to work at much lower voltages. eg a 3V6 zener will start to work at 2V7 with 1mA of current.

 

2) They are very capacitive.  A 3V6 Zener can easily be 400pF or more. That'll play havoc with any high frequency signals.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have also, experimentally, used blue leds in place of the zeners. They worked.

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:

So... I guess you could mark post#28 as the solution?

 

 

I will post a summary of it once I do a little more experimentation with the zener to identify exactly what aspect of it was producing the problem. I also experimented with the clock by purposely adjusting the OSCCAL values,  as well as the supply voltages. That information might be useful for others. I will post it here in the next couple of days, and then I would consider the matter solved.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:
I will post it here in the next couple of days, and then I would consider the matter solved.

That would be greeat.

 

See Tip #5 (in my signature) for how to mark it as the solution.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:

I will post a summary of it once I do a little more experimentation with the zener to identify exactly what aspect of it was producing the problem. I also experimented with the clock by purposely adjusting the OSCCAL values,  as well as the supply voltages. That information might be useful for others. I will post it here in the next couple of days, and then I would consider the matter solved.

Sounds good, likely the capacitance of the zener was too high. As mentioned LED may be a better clamp and you can use fast diodes + single clamp to reduce CL.

The hardware of the laptop must have been more tolerant ? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would put back in the zeners, they are there for protection.

But if you have a 1,75V zener it might start conducting at 1,4V already ( check the datasheet) So instead of a signal level of 3,6V you only get 2,8V that might not be high level enough for the host chip.

 

As the processor needs to be running at 12MHz or more you might need a 5V supply for that. So that is why the schematic has the processor running smoothly at 5V, but as the USB bus is only 3V (and the host might get damaged if you put 5V on with to high a current on the pin) the 3V6 zeners have been put in. The tiny will detect a high level at that voltage level and the PC host chip is also very happy.

 

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a brief summary: 

Attiny45 using V-USB was surprisingly tolerant of frequency and voltage shifts. In my case, it worked for CPU frequencies between 16.5 MHz and 17 MHz, but not below 16.5 MHz. It worked for VCC voltages as low as 3.3V or as high as 4.3V. Using Zeners on the data lines just didn't work for me, even though I measured the voltage to be about 3.5V. These were generic signal Zener diodes (but not the power regulating kind). so I am assuming they just weren't fast enough. 

I have a blog post on this at  http://sarangan.org/electronics/2020/06/27/v-usb-on-attiny45-85-microcontrollers/

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are no bypass capacitors mentioned in your blog. Do not underestimate the need for these.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
There are no bypass capacitors mentioned in your blog. Do not underestimate the need for these.
Kartman wrote:
There are no bypass capacitors mentioned in your blog. Do not underestimate the need for these.

 

I have capacitors on the power lines (but not shown on the schematic), but not on the data lines. If there were supposed to be capacitors on the D+/D- lines, I wasn't aware of that. The V-USB documentation makes no mention of it. 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:
but not shown on the schematic
Someone (a novice) seeing the schematic might infer no caps needed. I am sure Kartman was NOT suggesting caps on the D+/D- lines.

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:
I have capacitors on the power lines
Not the power lines, the power pins of the AVR.  As in, a 100nF cap across the VCC/GND pins, and as physically close to the pins as possible, with as short a connection as possible.

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]