Dangerous Prototypes

In development => Project development, ideas, and suggestions => Topic started by: cmdrk33n on August 01, 2012, 11:04:38 pm

Title: DTR signal for attiny's running avr-cdc
Post by: cmdrk33n on August 01, 2012, 11:04:38 pm
Hello,

I want to reuse my attiny85 running the avr-cdc firmware for my next DIY Arduino, but this time it would be nice to have the autoreset feature onboard (pressing reset for uploading sketches sucks sometimes). So i've started to hack the DTR signal into the avr-cdc firmware for the tiny chips. It's currently working for the tiny85. in the next few days, i will upload the missing bins for tiny45 and tiny2313...

I've also made a walkthrought for all the code changes i've made.

You can find everything on my blog:

http://www.cmdrkeen.net/2012/08/01/avr- ... -and-2313/ (http://www.cmdrkeen.net/2012/08/01/avr-cdc-gets-dtr-signal-for-tiny4585-and-2313/) 

Have fun :)

oh, since iam the only person so far that have tested my code, it would be great to get some feedback if someone discovers a problem ;-)

------------------------- Edit -------------------------
You can find the tiny2313 code in my github repo, it provides you the DTR signal when you run this chip @12Mhz

https://github.com/tgoehlert/avr-cdc/tr ... 4/tiny2313 (https://github.com/tgoehlert/avr-cdc/tree/master/cdc232.2011-06-24/tiny2313)

Since i don't have an attiny2313 laying around, i could'nt test it until now.


i've made a small demo for the modified tiny45/85 version:

http://www.youtube.com/watch?v=OvdGLPAbftc (http://www.youtube.com/watch?v=OvdGLPAbftc)
Title: Re: DTR signal for attiny's running avr-cdc
Post by: kehribar on August 01, 2012, 11:40:34 pm
Hi,

This is a nice hack! :)

I'll test your version soon and will update the compiled cdc232 firmware for Little Wire with your additional hack accordingly :)

ihsan.
Title: Re: DTR signal for attiny's running avr-cdc
Post by: kehribar on August 01, 2012, 11:41:11 pm
[quote author="MickM"]Hi;
  you can post URL's directly now that you have several posts.

I went to your site.
It is very hard to read your changes, grey on black is not good.
Iinstead of an image, post the text/html.
That way I can cut and paste.

Anyway - good job!.

Will wait for the source files.

Mick M[/quote]

Let me help him: :)

https://github.com/tgoehlert (https://github.com/tgoehlert)
http://www.cmdrkeen.net/2012/08/01/avr- ... -and-2313/ (http://www.cmdrkeen.net/2012/08/01/avr-cdc-gets-dtr-signal-for-tiny4585-and-2313/)

ihsan.
Title: Re: DTR signal for attiny's running avr-cdc
Post by: cmdrk33n on August 02, 2012, 07:01:59 am
Hello,

thank you very much for the feedback! :-D

@MickM: yes, this theme sucks for comments and defines, bit compared to the others, it's the niced. But far away from beautyfull of course.

sadly i didn't get your point with that image problem, because the actual code is text/html. or do you mean something else?
Title: Re: DTR signal for attiny's running avr-cdc
Post by: cmdrk33n on August 02, 2012, 10:10:09 am
No problem :)

i'm still searching "the one syntax highlighting plugin for wordpress to rule them all" :)
Title: Re: DTR signal for attiny's running avr-cdc
Post by: cmdrk33n on August 06, 2012, 03:30:48 pm
Short update:

I've made a small demosntration of my firmware (running on a attiny85) triggering the reset and uploading a sketch.

http://www.youtube.com/watch?v=OYlMTR1l7nM (http://www.youtube.com/watch?v=OYlMTR1l7nM)

i still need to verify my changes on a attiny45 and attiny2313, i will post some results for these as soon as i have them :-)
Title: Re: DTR signal for attiny's running avr-cdc
Post by: cmdrk33n on August 19, 2012, 11:23:25 pm
Hello,

i'm back from vacationand here is the fix for setting the DTR sig on the attiny45/85 active low:

simply change

            PORTB = (PORTB&~(1<<UART_CFG_DTR))|((rq->wValue.word&1)<<UART_CFG_DTR);

to

            PORTB = (PORTB&~(1<<UART_CFG_DTR))|(!(rq->wValue.word&1)<<UART_CFG_DTR);

i have also decided to don't put work into the attiny2313, because you can simply use the 16 and 20 mhz version from the original firmware, this gives you cts, rts and dtr.
dtr is on pin5.

iam currently writing a detailed tutorial for using avr-cdc with several chips. yo can find all my veryfied .hex files on my blog and github repo in the next days (when my tut is also finished).
Title: Re: DTR signal for attiny's running avr-cdc
Post by: cmdrk33n on August 22, 2012, 09:59:34 am
Hey there,

i need some help from you all :-)

i've started the howto series about avr-cdc and begun to make a seperate post for each chip variant (attiny45/85,attiny2313 and atmega8). There is currently only the attiny45/85 post finished.

Now my question for you: would it be nicer to put all the chips in one post or is it ok to have three different posts for each chip?

you can find all relatet posts here:

http://www.cmdrkeen.net/category/electr ... unleashed/ (http://www.cmdrkeen.net/category/electronics/avr-cdc-unleashed/)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01082080008session_write_close ( )...(null):0
20.01112211600ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01112212376Database_MySQL->query( ).../DatabaseHandler.php:119
40.05362351112Database_MySQL->error( ).../Db-mysql.class.php:273