Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Reset line from usb interface

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 29 January 2012, 20:02 PM    Post subject: Reset line from usb interface Reply with quote

I'm using a USB to 3.3v interface in a project and am having an issue getting it hooked up so i can download s/w, and the processor 'starts' without the usb plugged in.

Currently I have a 1k resistor in series in the reset line and 1.5k resisotr tieing the reset line to 3.3v

However i find i can download ok, and when the usb is removed the program starts ok. but if i leave the unit for a while it then refuses to start until i plug in the usb again. I've fiddled with the resistor values and this is the best place i can get to, but TBH I'm not really certain what the right approach is here.

thanks
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 29 January 2012, 21:23 PM    Post subject: Re: Reset line from usb interface Reply with quote

FFMan wrote:
Currently I have a 1k resistor in series in the reset line and 1.5k resisotr tieing the reset line to 3.3v
Is there an external pullup at the AVR reset pin, too? If so, what value? Clearly, you have a voltage divider and the voltage at the reset pin will be affected by the entire set of values.

FFMan wrote:
it then refuses to start until i plug in the usb again.
A complete schematic would be a useful aid for forming hypotheses.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 29 January 2012, 21:30 PM    Post subject: Reply with quote

You may recall I am using the 128a1 on the sparkfun break-out board. The documenation shows no resistors on the board.

> Is there an external pullup at the AVR reset pin, too?

not sure i understand the question. Pin 90 is the reset and I have connected this to dtr via the arrangement described. Is this not the correct pin ?
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 29 January 2012, 21:52 PM    Post subject: Reply with quote

what is supposed to be happening to the reset line during:-

1) load
2) run

guess my options depend on what my usb interface is doing ?

thanks
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 29 January 2012, 22:26 PM    Post subject: Reply with quote

FFMan wrote:
> Is there an external pullup at the AVR reset pin, too?
not sure i understand the question. Pin 90 is the reset and I have connected this to dtr via the arrangement described. Is this not the correct pin ?
That is the correct pin. I had forgotten that you are using the SparkFun breakout board. Even though it doesn't have an external pullup on the reset line, there is an internal pullup in the 50K to 80K range. Using this value and the values of the other resistors you should be able to work out the voltage at the reset pin when the USB device is holding the line low and when it is holding it high. You have to be certain that the signal meets both the minimum voltage to be recognized as a logic 1 as well as the maximum voltage to recognized as a logic zero.

Here again, using a proper level converter will make your life simpler, ensuring that the logic levels are appropriate. (But see the comments further below.)
FFMan wrote:
what is supposed to be happening to the reset line during:-
1) load
2) run
In both cases, the reset line must remain above the minimum input high voltage. However, to get into load mode, the DTR line is toggled a few times causing reset pulses - assuming that you are using the recommended ATN circuitry. The transistor in the ATN circuitry serves as a level converter since its collector is pulled up to the voltage of the AVR chip.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 29 January 2012, 22:36 PM    Post subject: Reply with quote

> assuming that you are using the recommended ATN circuitry.

probably not - i'm using one of these http://www.byvac.com/bv3/index.php?route=product/product&path=48&product_id=85 set to 3.3v mode with dtr simply connected as described before to the reset line.

it use the ftdi chipset - you i'm expect know this much better than me.

what would be the right way to use this module do you think ?

thanks
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 30 January 2012, 0:35 AM    Post subject: Reply with quote

FFMan wrote:
what would be the right way to use this module do you think ?
The problem with directly connecting the DTR line to the reset pin is that as long a DTR is at zero volts the AVR will be held in reset. That's why our recommended ATN circuitry (lower part of each circuit on that page) contains a series capacitor. In conjunction with the resistors and transistor this creates a pulse on each positive going transition of DTR.

Depending on how the FTDI chip is configured regarding the logic sense of DTR (normal or inverted) you may have to change that but I believe that it may work with either sense of DTR due to the way that the downloading code pulses DTR. It is simple to change the FTDI configuration with FTDI's MProg utility or the successor.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 30 January 2012, 9:15 AM    Post subject: Reply with quote

thanks i'll have a look at the utilitiy - seems like ft_prog is the current one.

Is inserting a capacitor in series on my dtr line another option ?
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 01 February 2012, 20:01 PM    Post subject: Reply with quote

finally found time to run the mt_prog against the usb interface, but i see no useful option to fix my issue.

Were you thinking Don there might be an option to toggle dtr when its sets high or similar, I can set it to be inverted but as you said i don't think that will fix it.

I guess the best option is the transistor option as shown in the refernece manual
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 01 February 2012, 20:35 PM    Post subject: Reply with quote

FFMan wrote:
Were you thinking Don there might be an option to toggle dtr when its sets high or similar, I can set it to be inverted but as you said i don't think that will fix it.
No. I was referring to the ability to set the logic sense of the data and control signals. I don't recall testing to see if the initial level of the DTR signal affected the ability of the ZX to detect the "attention" sequence. I suspect that it doesn't but it may.

The high-pass filter/transistor combination is what you'll want to use, as shown in the all of the serial interface examples for the ZX.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 02 February 2012, 6:57 AM    Post subject: Reply with quote

can you recommend any changes in component values given my dtr will be a 0-5v from the usb interface rather than an rs232 range ?

thanks
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 02 February 2012, 15:37 PM    Post subject: Reply with quote

FFMan wrote:
can you recommend any changes in component values given my dtr will be a 0-5v from the usb interface rather than an rs232 range ?
I believe that no changes are needed. We use the same component values with both 3.3V and 5V DTR signals.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 265

Posted: 04 February 2012, 17:31 PM    Post subject: Reply with quote

almost worked using the recommended atn circuit. i had to reduce the 10k pullup on the /rst line to make it run and load properly. i had 1k handy so not very scientifically arrived at but it works.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group