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
Switch off COM1 temporarily under software control? (ZX328L)

 
Post new topic   Reply to topic    Forum Index -> ZX-40
Author Message
kranenborg



Joined: 27 Jul 2009
Posts: 37
Location: Uppsala, Sweden

Posted: 06 February 2010, 23:56 PM    Post subject: Switch off COM1 temporarily under software control? (ZX328L) Reply with quote

Hello,

On a ZX-328L I would like to experiment with the BusRead/BusWrite commands (bit banging version) for adding external static 32Kbx8 RAM. However this appears not really possible since none of the ports is fully "free" in that all 8 bits are user-configurable (Port C has only 6 pins, Port B includes crystal connections, and Port D includes the Com1 download interface).

Still I could imagine that it could be possible to "shut down" Com1 under software control, making it temporarily "deaf" to a download signal and thus making Port D fully available (which could be useful for other applications as well). Is there a possibility to do so ?

Best regards,
Jurjen
Back to top
dkinzer
Site Admin


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

Posted: 07 February 2010, 0:25 AM    Post subject: Re: Switch off COM1 temporarily under software control? (ZX3 Reply with quote

kranenborg wrote:
I could imagine that it could be possible to "shut down" Com1 under software control, making it temporarily "deaf" to a download signal and thus making Port D fully available [...]
You may be aware that Com1 cannot really be closed. If you invoke CloseCom() on channel 1 it doesn't really get closed. Rather it is closed and then automatically re-opened using the default parameters.

However, I believe that you can achieve the same effect by directly disabling the USART's transmit and receive sections. This can be accomplished by manipulating the USART control registers directly. The bits of interest are TXEN and RXEN in the UCSR0B register. Before setting those bits to zero, you should wait until a call to StatusCom() indicates that there is no more data to be transmitted or in the process of being transmitted.

Unless you've configured your ZX for an ATN character, disabling the USART will not make the ZX "temporarily deaf" because downloads are typically initiated by a special reset sequence.
Back to top
kranenborg



Joined: 27 Jul 2009
Posts: 37
Location: Uppsala, Sweden

Posted: 07 February 2010, 0:48 AM    Post subject: Reply with quote

Thanks Don, that is exactly what I hoped for because this adds quite a bit on a ZX-328. Two bits - and a full port - really count on a small device, and now the BusRead/BusWrite/DefineBus commands can be applied as well.

Maybe it would be an idea to add Connect / Disconnect commands to the library for (re)setting the corresponding USART bits?

I assume that changing the fuse settings for the reset pin (to gain one extra port pin, namely C.6) will be impossible for a program, for it is a fuse, literally ..

/Jurjen
Back to top
dkinzer
Site Admin


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

Posted: 07 February 2010, 1:24 AM    Post subject: Reply with quote

kranenborg wrote:
I assume that changing the fuse settings for the reset pin (to gain one extra port pin, namely C.6) will be impossible for a program, for it is a fuse, literally ..
Yes, it cannot be changed programmatically. Even if that were possible it would be inadvisable because reset is required as part of the download protocol.
Back to top
kranenborg



Joined: 27 Jul 2009
Posts: 37
Location: Uppsala, Sweden

Posted: 07 February 2010, 1:54 AM    Post subject: Reply with quote

I checked the situation with the Oak Micro ZX-328nu and note that the approach as discussed here should definitely not be applied to that device since the Tx and RX pins of the uC are directly connected to the on-board USB chip.

/Jurjen
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 07 February 2010, 2:31 AM    Post subject: Reply with quote

kranenborg wrote:
I checked the situation with the Oak Micro ZX-328nu and note that the approach as discussed here should definitely not be applied to that device since the Tx and RX pins of the uC are directly connected to the on-board USB chip.
I agree Smile

But then again I wouldn't stretch such a small device. If I wanted some additional RAM for my ZBasic device I would buy something like the ZX-128ne which supports up to 64K RAM with zero wait states (i.e. isn't slow compared to big-banging to RAM yourself).
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-40 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