ZX-32x4 verse ZX-24x pinouts

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

ZX-32x4 verse ZX-24x pinouts

Post by tomhilton »

The ZX-24x has many I/O pins tied together, for pin defining in the compiler, so for example PC3(TxDo) and PB3(Dac1) are pin P9, but
on the ZX-32x4 they are separate pins.
Since the compiler has no selection for the ZX-32x4 how do you select
the pins for this microprocessor. I would like to be able
to use this pins separately.

If fact, the compiler does not let you select any of the
ATxmega processors. Show how do you program them?

Tom Hilton
Thomas Hilton
www.arizonaskys.com
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZX-32x4 verse ZX-24x pinouts

Post by dkinzer »

tomhilton wrote:Since the compiler has no selection for the ZX-32x4 how do you select the pins for this microprocessor.
I assume that you are referring to the IDE. Because of the large number of devices that the compiler supports, the IDE does not initially show all of them in the combobox in the "Device Options" dialog. You can change the set of devices that does appear by clicking the "Edit Target List..." button in the upper right hand corner of the "Device Options" dialog.

Doing so will bring up a new dialog that contains two listboxes populated with device names. The left hand listbox contains devices that will be shown in the combobox on the "Device Options" dialog while the right hand listbox contains the devices that will not be shown. You can move devices from one listbox to the other by first selecting them (multiple selection via ctrl-click and shift-click is supported) and then clicking the appropriate arrow button appearing between the listboxes. After clicking OK in that dialog, the changes will be reflected in the combobox on the "Device Options" dialog immediately and on all future invocations.
- Don Kinzer
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

Post by tomhilton »

Well Don, the Edit targets box is not working for me. I cannot get it to move a microprocessor from either panel to the other panel.
I have tried the ZX-32a4 several times.
I highlight the ZX-32a4 in the right panel, hit the left pointing arrow (now highlighted), the arrow changes to non-highlighted and the no ZX-32a4 on the left list. I have tried about 10 different processors and none of them will move.

I even tried to move them from the left side to the right side, thinking that the list on the left can only hold 9 entries.

It just seems to lock up.

I downloaded and installed this compiler again yesterday, using the complete installer. What else do I have to do?
Thomas Hilton
www.arizonaskys.com
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

Post by tomhilton »

PS
I just tried the Device Edit on 2 more computers. They are all Win 7 32 bit machines, 2 are pro, the 3 are ultimate. It does not work on any of them. The Ultimate machine has almost nothing installed except the operating system as I just rebuilt it.
All have at least 4 gigs of ram, and 2 are quad processors and the other a dual processor.
Thomas Hilton
www.arizonaskys.com
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

I can speak from experience that this used to work just fine. A couple of weeks ago I noticed the same problem but thought it was just me.

A workaround (although probably not santioned) is to edit the User Options file (SciTEUser.properties) and manually change the 1 and 0 for each device e.g.

Code: Select all

show.target.device.ZX24x=0
show.target.device.ZX24xu=1
Save the file, exit the GUI and then start it again. The device will now appear in the list.

I'm sure Don is working on a fix as I am appending this.
Mike Perks
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

Post by tomhilton »

Thanks MikeP
Thomas Hilton
www.arizonaskys.com
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

tomhilton wrote:[...] the Edit targets box is not working for me.
I believe that we have located the source of the problem. A new version of the IDE is available via the link below. After downloading, simply extract the .exe file to the IDE sub-directory of the ZBasic installation directory.

http://www.zbasic.net/download/ZBasicID ... _1-5-9.zip
- Don Kinzer
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

Post by tomhilton »

Thank Don
That fixed it. Now I can see what real trouble I can make. :?
Thomas Hilton
www.arizonaskys.com
tomhilton
Posts: 26
Joined: 03 July 2009, 8:24 AM
Location: Peoria AZ
Contact:

ZX-32x4 Serial ports

Post by tomhilton »

I assume that TxD0(Pd3) & RxD0(Pd2) is Com1 the programing port.
and no pin numbers are specified for this com port in the code
DefineCom(0,0) because of this statement:

"For mega32-based ZX devices (e.g. the ZX-24), the ability to define the characteristics of Com1 is not
supported nor is half-duplex bussed mode. Specifying the same pin for rx and tx on these devices will produce undefined results." from the ZbasicSysLib for DefineCom

Now if I want to use the other hardware channels, how do I define them?
Do they each have there own com port identifies such as com 2,3,4,5 or do you put the pin numbers in the DefineCom(channel,rxPin,txPin,flags) so that maybe com2 would be
DefineCom(2,26,27,flags) and
com3 would be DefineCom(3,32,33,flags) and
com4 would be DefineCom(4,12,13,flags) and
com5 would be DefineCom(5,16,317,flags)

If not this the how. You say they have 5 hardware serial port, please tell me that the Zbasic compiler supports this without having to write C or assembly.
Thomas Hilton
www.arizonaskys.com
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZX-32x4 Serial ports

Post by dkinzer »

tomhilton wrote:For mega32-based ZX devices (e.g. the ZX-24), the ability to define the characteristics of Com1 is not supported nor is half-duplex bussed mode. Specifying the same pin for rx and tx on these devices will produce undefined results.
This caveat does not apply to any of the xmega-based ZX devices. Rather, it applies only to the mega32-based ZX devices (ZX-24, ZX-40 and ZX-44) all of which are no longer in production.
tomhilton wrote:Now if I want to use the other hardware channels, how do I define them?
In most cases, you do not need a DefineCom() call to prepare any of the hardware UART channels: 1, 2 and 7-12. The Rx and Tx pins for the hardware UART channels are pre-determined and cannot be changed. By default, the hardware UART channels are operated in 8-bit data, no parity, 1 stop bit mode and you only need to use DefineCom() for a hardware UART channel if you want to specify an operating mode different from that default.

The RxD and TxD pins for the hardware UART channels on the ZX-32a4 are given in a table in the OpenCom() description, excerpted below where the rightmost column is the RxD pin.

In the general case, to use Com2 or Com7 to Com12 all that is necessary is to call OpenCom() specifying the channel number (i.e. 2 or 7-12), the baud rate and the queues.
Attachments
The RxD pin is the rightmost column.
The RxD pin is the rightmost column.
ZX32a4_ComChannels.jpg (13.82 KiB) Viewed 6676 times
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Here is a simple program to prepare Com7 and send a string. This will work on any of the hardware UART channels (1, 2, 7-12) simply by changing the value of chan. Note, however that Com1 is a special case because that serial channel is open by default when the program starts running. Consequently, a CloseCom() call is needed prior to the OpenCom() for the case of Com1.

Code: Select all

Dim iq(1 to 20) as Byte
Dim oq(1 to 40) as Byte

Const chan as Byte = 7

Sub Main()
    Call OpenQueue(iq)
    Call OpenQueue(oq)
    Call OpenCom(chan, 9600, iq, oq)
    Call PutQueueStr(oq, "Hello, world!" & Chr(&H0d) & Chr(&H0a))
End Sub
- Don Kinzer
Post Reply