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
BX-24 code conversion
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
dkinzer
Site Admin


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

Posted: 10 January 2006, 23:41 PM    Post subject: Reply with quote

The firmware doesn't support this. When DefineCom() is called, the pin specified for reception is made an input and then the pin specified for reception is made an output in the idle state.

The only way to support half duplex, single queue operation would be to add a way to enable/disable the transmit and receive sections, essentially a "switch directions" command.
Back to top
dkinzer
Site Admin


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

Posted: 11 January 2006, 0:57 AM    Post subject: Reply with quote

If you'd like to experiment with selectively enabling the transmit and receive sections of the software UART channels, you can try the following code. This is for experimental purposes only - it is not intended as a long-term solution.

N.B.: the code is specific to a certain firmware version as indicated.

Code:
' This experimental subroutine can be used to selectively enable and disable
' the transmit and receive sections of one of the software UART channels 3-6.
' The 'flags' parameter contains bits as follows:
'
' &H01 - enable the receive channel
' &H02 - enable the transmit channel
'
' This is coded specifically for firmware version v1.1.2.  It may not work
' with other firmware versions.  To confirm that the address of the internal
' data structure is correct, check the bytes at offset 7 and 8 from the
' value of 'uartData' defined below.  Those bytes should contain the low byte
' of the memory-mapped I/O port for the transmit pin and the port bit mask
' for the transmit pin, respectively for Com3.  Likewise, offsets 14 and 15 should
' contain the same values for the receive pin for Com3. 
' The data will be valid only after DefineCom() has been called for Com3.
'
Sub enableCom(ByVal chan as Byte, ByVal flags as Byte)
   Const uartData as UnsignedInteger = &H4a9
   Dim mem(1) as Byte
   Call SetBits(mem(uartData + 5 + CUInt((chan - 3) * 21) - mem.DataAddress), &H03, flags)
End Sub
Back to top
DH*
Guest





Posted: 11 January 2006, 11:53 AM    Post subject: Reply with quote

I'll try to play with it once I receive my ZX-24.

The existing boards for this app were designed to use two pins so this is not critical. I expect I'll have adequate RAM so an extra queue isn't really a problem. I'm just trying to learn where the limits and gotchas might be.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 Time synchro. with the server - Timezone/DST with your computer
Goto page Previous  1, 2
Page 2 of 2

 


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