Mixing 3 circuits together for Attiny85

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

Hello guys,

 

I was looking for a schematic of a attiny85 usb implementation and i found one from Yoni013p in this forum. Here is my problem : Im trying to make a sort of micro gameboy with a tetris game in it. I drew the schematic of a 3.7v Ion battery regulator connected to the "tetris game" circuit coming from this (https://github.com/jaromaz/ATtin...). The interface is a really small Oled screen.

 

Actually my goal was to load the code in the Attiny before and then solder all the components on the etched copper board, which make the project not flexible.

 

It would be great to be able to load a new program in the game console in the future. Previously i was planning a simple SPDT switch on the battery + trace but it' s not that simple obvioulsy..

 

As im newly electronic student with a lack of knowledge. Im looking for help to understand if it possible to put the Attinty85 USB implementation inside the circuit i made. For example in my case the XTAL1 and the XTAL2 are used in different way in the 2 circuits... So i don't know if it's fixable.

 

What do you think ?

 

Also sorry for my english, i know it's not completly bad but it's not fluent.

 

CHeers and thanks for your time

Attachment(s): 

Hello Hello

Last Edited: Thu. Jan 13, 2022 - 09:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guideb wrote:
to load the code in the Attiny before and then solder all the components

 

Welcome to AVRFreaks!

 

Our experience is that IT WILL NOT work at the first. There are always some problems!

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

Why do you have to do the USB connection in the AVR itself? Can't you add a USB interface chip and let that get on with the USB stuff (maybe with it's own crystal/clock etc). But why pick tiny85 anyway? You could use an 8bit AVR which already has a USB peripheral (32U4 is a common choice) which will take most of the CPU requirement off the USB interface (and it will have a proper clock system designed to support USB speeds).

 

When at the requirements/specification/design stage of a project you should build a list of all your requirements (peripherals, CPU budget, RAM budget) and this would in turn guide you to the right chip to use for a job. Don't just pick a chip because "I've got some in here in a box" and then try to shoe-horn your design into something that is not so appropriate.

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

Thank you and all the best for the new year !

Hello Hello

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

I was looking for a way to be able to load programs in the Attiny85 from usb even if the board is fully mounted. What i have is this : https://www.amazon.fr/Digispark-...

 

May be i was wrong about USB Attiny schematic, i found this one way more simple.  So with a SPDT switch i might be able to add this to my original circuit.

 

Attachment(s): 

Hello Hello

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

Ok i think im full stupid...

 

I can use the 5V output from the digispark Attiny board to go --> battery charge controller --> and then the Ion battery...

 

Put a SPDT switch somewhere i need to figure it out : position 1 = the gameboy is off and i can load programs thru usb... Position 2 = the battery is charging up if connected to the usb and the game is playable either if connected or not to the usb as the battery does his job.

Sorry for the time wasting

Hello Hello

Last Edited: Thu. Jan 13, 2022 - 10:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Guideb wrote:
I was looking for a way to be able to load programs in the Attiny85 from usb even if the board is fully mounted.
But the "usual" solution for that is simply to put a UART not USB based bootloader into the chip (it's 100 times easier doing UART than USB!) then the connection from PC to AVR is using a $2 USB-TTL cable from ebay:

 

https://www.ebay.co.uk/itm/22191...

 

The "clever bit" that does the USB stuff is a CH430/PL2303/CP2102 on that little circuit board - this removes the need for you to worry about doing it inside the AVR.

 

(in fact almost all "Arduino" boards are exactly like this - they have an AVR but in one corner of the board they have a CH430/PL2303/CP2102/etc doing the very same thing that those $2 ebay cables do)

 

The one exception among Arduino is the one that is based on a mega32u4. That one does the "USB thing" inside the AVR itself. It can do that because 32U4 has a real USB peripheral. But, really, those $2 cables are the easy solution for your own design.

Last Edited: Thu. Jan 13, 2022 - 11:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The Digispark is a single ATtiny85 chip what implements V-USB and sells for about $8.

 

Since you can buy a Nano clone or a Uno clone for a similar price the Digispark seems a bad deal.

But the physical shape might be attractive.

 

Punters think that few pins is easier !!

 

Yes,  the ATmega32U4 can run its own CDC Serial.   Likewise many ARM chips can run CDC USB Serial.

 

However the beauty of Uno / Nano with their separate USB- Serial chip is that nothing can go wrong.   Which is why the original Arduino concept is so good for artists, learners,  pot smokers, ...

 

David.

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

clawson wrote:
You could use an 8bit AVR which already has a USB peripheral (32U4 is a common choice) which will take most of the CPU requirement off the USB interface (and it will have a proper clock system designed to support USB speeds).
yes Did Microchip made it in lower price ?

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

Last Edited: Thu. Jan 13, 2022 - 02:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem with doing USB on the tiny85 is most of the flash space is used up by the USB code, leaving little for the app, in this case the gameboy game, also the tiny85 has few i/o pins, at least two of which will be used by the USB.  

 

FF = PI > S.E.T

 

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

ki0bk wrote:
most of the flash space is used up by the USB code,
Not just the flash space - a lot of the CPU time is taken with servicing the bit-bang too - it's a "clever trick" but not really practical. I do wonder why anyone would spend $8 on this Digispark tiny85 board with various limitations when for less you can get an Uno or a Nano ??

 

EDIT: Oh I see, on AliExpress/Banngood it is a lot less than $8 - I guess that is the attraction?

 

If this is about fitting something in a "Gameboy" case then surely an Arduino Nano would fit??

 

EDIT: interesting to note that they chose 32U4 for this: https://www.arduboy.com/shop/p/a...

Last Edited: Thu. Jan 13, 2022 - 02:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

clawson wrote:

EDIT: Oh I see, on AliExpress/Banngood it is a lot less than $8 - I guess that is the attraction?

If you buy Uno / Nano on Aliexpress it is pretty cheap too.

 

I don't have the patience.   "Free Delivery" generally means a LONG WAIT.

Pay a nominal sum and it might arrive in 12-14 days.

 

Once you have the Digispark on your desk,  you still have to make it work with your custom code.  e.g. days, weeks, months, ...

 

David.