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
DTR timing

 
Post new topic   Reply to topic    Forum Index -> ZBasic IDE
Author Message
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 26 November 2006, 23:15 PM    Post subject: DTR timing Reply with quote

Don
Sorry to touch this area again, but...
This new computer of mine refuses to ID the ZX24a via the ethernet to serial bridge. The older computer was intermittent - some days OK, some not, for no good reason I could find.

So with this new one (the native serial port works fine), and the ethernet bridge, I did some testing by adding status displays to the ZLoad DLL source that you provided. In reading that source, I'm confused a bit and maybe you can explain...
The code in atn() multiplies period * duty, but duty is an integer rather than fraction less than one (e.g., 1 to 100%). The default period is 10mSec and the default duty is 1.

In another post here on this topic, I understood that DTR must toggle 3 or more times, where 20mSec <= period <= 50mSec (vs. the 10mSec I noted above). I also see that the IDE allows one to set the period < 20mSec. The duty cycle seems largely irrelevant because of the capacitor coupling to create a pulse, but duty cycle may be important to certain devices like ethernet bridges, so the default in the IDE might best be 50% or so.

Maybe a scope photo or two?

In addition to fiddling with wrote a visual basic 6 program that toggles DTR using the Windows functions

Code:

Declare Function QueryPerformanceCounter Lib "kernel32.dll" (ByRef lpPerformanceCount As Currency) As Boolean
Declare Function QueryPerformanceFrequency Lib "kernel32.dll" (ByRef lpPerformanceFrequency As Currency) As Boolean

to create precise timing and experiment. But alas, the ZX24 responds with a byte = 253 decimal rather than the '<' PROMPT in command mode - which I assume is at 19.2Kbaud.

I wish there were a better or alternate way to force a download than this rather precarious DTR toggling scheme. At least, the AVR side IMO should be far less stringent about timing. And it would be good to allow use of RTS instead of DTR since not all devices implement DTR.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic IDE 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