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
Where is the 2nd h/w uart on a zx24n ?

 
Post new topic   Reply to topic    Forum Index -> ZBasic Native Mode
Author Message
FFMan



Joined: 09 Jan 2010
Posts: 223

Posted: 23 April 2010, 13:10 PM    Post subject: Where is the 2nd h/w uart on a zx24n ? Reply with quote

can any pins be used to make use of the 2nd h/w uart on the zx24n or are there specific pins ?

I can't locate any documentation giving the answer.

thanks
Back to top
pdubinsky



Joined: 25 Nov 2005
Posts: 66
Location: South Carolina

Posted: 23 April 2010, 13:18 PM    Post subject: Zbasic Native Mode Com2 Reply with quote

Com2 pins are hardware assigned. See USART chart on page 17 of the ZBasic System Library Reference Manual.

P
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 223

Posted: 23 April 2010, 14:25 PM    Post subject: Reply with quote

great thanks

I see an interesting little foot-note that appplies to zx24n of:-

¹For these devices, the Com1 signals are logically inverted, the Com2 signals are not, however

so does that mean that if i convert code from zx24 using a software usart that i need to invert the signals or does does this mean the h/w usart behaviour is the same as the s/w usart ?
Back to top
pdubinsky



Joined: 25 Nov 2005
Posts: 66
Location: South Carolina

Posted: 23 April 2010, 14:37 PM    Post subject: Zbasic Native Mode Com2 Reply with quote

Quote:
so does that mean that if i convert code from zx24 using a software usart that i need to invert the signals or does does this mean the h/w usart behavior is the same as the s/w usart ?

I'm not sure exactly what you are asking but you cannot change the invert state on comm2. See page 70, DefineCom(). If the receiving end is expecting an inverted signal, you'll have to add hardware inverters b/n h/w comm2 and the receiving end since you can't invert the signal in software.

P
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 223

Posted: 23 April 2010, 15:18 PM    Post subject: Reply with quote

ok i see - so i can't set/change the invert on a h/w usart but i can on a s/ware one.

So its possible I will need to add h/w to invert my signals if the h/w usart is opposite to my device (a GPS module). I need to go take a look....
Back to top
dkinzer
Site Admin


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

Posted: 23 April 2010, 16:19 PM    Post subject: Reply with quote

FFMan wrote:
so i can't set/change the invert on a h/w usart but i can on a s/ware one.
That is correct. You must always check the datasheet for the device you're connecting to find out if it uses inverted or non-inverted serial signals. If you are using a SW UART on the ZX , you then select the matching polarity in the DefineCom() call. If you are using a HW UART on the ZX, you must add external inversion if the polarity does not match that of the external device. The issue is the same in both cases; the only difference is in how you implement the matching polarity.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 223

Posted: 23 April 2010, 17:58 PM    Post subject: Reply with quote

so, if i open my current sw port with a mask of

by_Mask=bx00001000

will i need external inverting h/w or not ?

thanks
Back to top
dkinzer
Site Admin


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

Posted: 23 April 2010, 18:31 PM    Post subject: Reply with quote

FFMan wrote:
will i need external inverting h/w or not ?
If you are using a SW UART (Com3 to Com6) you never need an external inverter, assuming the device operates at TTL signal levels. Rather, if you need inverted logic just add &H80 to the flags for DefineCom(). Note, however, that if the external device uses standard RS-232 signal levels you'll have to use an external level converter (which includes a signal inversion).

An external inverter is needed in these cases:
  • You're using Com1 on a 24-pin ZX device and the device with which you're communicating requires non-inverted signals.
  • You're using Com1 on a ZX device other than one of the 24-pin series and the device with which you're communicating requires inverted signals.
  • You're using Com2, Com7, Com8, etc. and the device with which you're communicating requires inverted signals.
If a device has a serial output signal, you can generally determine whether it uses inverted or non-inverted signals by checking the state of its serial transmit line when idle. If it is at logic 1 when idle then it is non-inverting. If it is is at logic 0 when idle then it is inverting.

If you're not sure whether the device outputs TTL signal levels or RS-232 signal levels, use a voltmeter to measure the voltage on the serial transmit line. If the voltage is 3 to 5 volts when idle, it is probably non-inverted TTL signal levels. On the other hand, if the idle voltage is -3 to -15 volts when idle, then it is using standard inverted RS-232 levels. In the latter case, you'll need an RS-232 level converter (which includes an inversion) to get non-inverted TTL signal levels.
Back to top
FFMan



Joined: 09 Jan 2010
Posts: 223

Posted: 23 April 2010, 21:40 PM    Post subject: Reply with quote

thanks don

what i was asking was that given the mask in my previous post works with my gps on a s/w channel, do you think i will be able to use a h/w channel without inverters ?

i ask because the project i'd like to modify to use he zx24n doesn't have any room for an inverter.

thanks
Back to top
dkinzer
Site Admin


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

Posted: 23 April 2010, 21:53 PM    Post subject: Reply with quote

FFMan wrote:
do you think i will be able to use a h/w channel without inverters ?
If communication with the external device works on a SW UART channel with the flags value of &H08, then it means that that device uses non-inverted, TTL-level I/O for its serial communication. That being the case, you should be able to use Com2 without external inversion. This conclusion is consistent with my earlier description of when you need inversion and/or level conversion.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Native Mode 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