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
com2 ,problems with bit stop

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
marcelo_bahia



Joined: 15 May 2009
Posts: 4
Location: argentine

Posted: 22 June 2009, 16:54 PM    Post subject: com2 ,problems with bit stop Reply with quote

I use the following configuration in Z24-P to transmit,com2 only tx pin11 8-p-2
(8 data bits, even parity, 2 stop bits at 115000.)
my problem is that no appear 2 stop bits y and alters the output bit
will have some problem with the progracion, which may be the error?
the z24 has a max232 connected, the images are a departure max232,view photo 8-p-1 (1 bit stop) and 8-p-2 (2 bit stop).

Code:
Const txPin as Byte = 11
Const channel as Byte = 2

Dim oq(1 to 40) as Byte

Dim b as Byte
Dim i as Byte
Dim Bstop as Byte

Sub Main()
 Bstop=2
 b=75  'letter K in ascii
   
  ' initialize the queues
  Call OpenQueue(oq)

  ' define the characteristics of the serial channel ,( channel 2,no Rx,only tx,8bitdata and 2bit parity even,bit stop)
  Call DefineCom(2, 0,txPin, &H38,Bstop)
 
  ' open the serial channel
  Call OpenCom(2, 115600, 0, oq)
 
 do
  'output port serie com2 micro 
  Call PutQueue(oq,b,1)
  Call PutQueue(oq,b,1)
 loop


[admin edit: added code tags]



Schematic Z24 max232.doc
 Description:

Download
 Filename:  Schematic Z24 max232.doc
 Filesize:  35.5 KB
 Downloaded:  2043 Time(s)


com_2.bas
 Description:

Download
 Filename:  com_2.bas
 Filesize:  616 Bytes
 Downloaded:  2040 Time(s)


set 8-p-2.jpg
 Description:
from Max232 tx ,Z24 set com2 tx
8bit Parity even 2 bit stop

Download
 Filename:  set 8-p-2.jpg
 Filesize:  55.06 KB
 Downloaded:  2001 Time(s)


set 8-p-1.jpg
 Description:
from Max232,Z24 set com2 tx
8bit parity even 1 bit stop

Download
 Filename:  set 8-p-1.jpg
 Filesize:  60.92 KB
 Downloaded:  2777 Time(s)

Back to top
dkinzer
Site Admin


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

Posted: 22 June 2009, 17:54 PM    Post subject: Re: com2 ,problems with bit stop Reply with quote

marcelo_bahia wrote:
my problem is that no appear 2 stop bits
You have discovered a previously undetected problem that seems to have been introduced around v2.5.0 of the VM. You can work around the issue by specifying a larger value for the stopBits parameter to DefineCom(), for example:
Code:
Call DefineCom(2, 0, 0, &H38, 3)
This works because the maximum number of stop bits on a hardware UART channel is two and, as the documentation states, any value above 1 will select two stop bits.
Back to top
marcelo_bahia



Joined: 15 May 2009
Posts: 4
Location: argentine

Posted: 23 June 2009, 11:58 AM    Post subject: Reply with quote

results

1)changing Call DefineCom(2, 0,0, &H38,3) ,for 2 stop bits as shown in photo 3 bit.jpg

2)changing Call DefineCom(2, 0,0, &H38,2) ,for 1 stop bits as shown in photo 2 bit.jpg

thank you Don



2 bit.jpg
 Description:

Download
 Filename:  2 bit.jpg
 Filesize:  57.06 KB
 Downloaded:  2764 Time(s)


3 bit.jpg
 Description:

Download
 Filename:  3 bit.jpg
 Filesize:  59.75 KB
 Downloaded:  2766 Time(s)

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