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
Small ZX devices: switching off COM1 -> freeing port D

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



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

Posted: 07 August 2010, 0:23 AM    Post subject: Small ZX devices: switching off COM1 -> freeing port D Reply with quote

The following small code example shows how all 8 bits of Port D can be made available for I/O by switching off the hardware UART for COM1. The latter operation makes D.0 and D.1 accessible to standard I/O operations via Register.PortD (although the compiler blocks PutPin operations on these two pins). This may be relevant for the smaller ZX variants where a full port is not always available, or for larger variants where a combination of I2C and ADC use precludes a fully available port as well.

The code is an outcome of the following discussion : http://www.zbasic.net/forum/about1278.html. The example in the attachment describes the use of a common-anode 7-segment display on port D. The code includes a description of the test hardware.

Jurjen Kranenborg



SevenSegmentTest.zip
 Description:

Download
 Filename:  SevenSegmentTest.zip
 Filesize:  1.12 KB
 Downloaded:  1455 Time(s)



Last edited by kranenborg on 23 November 2010, 22:18 PM; edited 1 time in total
Back to top
mikep



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

Posted: 07 August 2010, 0:36 AM    Post subject: Reply with quote

This code can only be used for native devices I believe. The code should have the following around it
Code:
#if Option.TargetCode="ZVM"
#error Unsupported device
#else
<< code goes here >>
#endif
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> Files 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