Preassembled Interface Kits

This forum is for posts that might be considered off-topic but that may be useful or interesting to members. Examples include posts about electronics or programming in general, other microcontrollers or interesting devices, useful websites, etc.
Post Reply
liam.zbasic
Posts: 163
Joined: 24 March 2008, 23:33 PM
Location: Southern California (Blue)

Preassembled Interface Kits

Post by liam.zbasic »

Free time is very scarce these days with the job and a newborn. Question... are the interface kits available pre-assembled and soldered? If so, what is the delta cost?

Also, I've been programming ZX-40A chips for about a year, and I'm ready to move on to the native devices. I'm happy to see the recent addition of the ZX-328n to wean me off the virtual machine chips. And the price is right too. Regarding the ZX-40n, is there a price reduction for purchasing multiple chips?

Thanks.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Preassembled Interface Kits

Post by dkinzer »

liam.zbasic wrote:are the interface kits available pre-assembled and soldered? If so, what is the delta cost?
We don't have them available as an item that can be ordered because there are several configurations depending on how you plan to use it. For example, are the square pins installed or not? If they are, are they tails up or tails down? If you expect to order them in volume, we can work out a special arrangement. If you want just a few, we'd be happy to assemble them for you at no additional cost.
liam.zbasic wrote:Regarding the ZX-40n, is there a price reduction for purchasing multiple chips?
The discount schedule begins at 15% for 10-24 units. Higher discounts are available higher volumes which we can discuss via email. Discounts are implemented using a "discount code" that is entered on the Payment Information page. The discount code for 10-24 units is Q10D15.
- Don Kinzer
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Re: Preassembled Interface Kits

Post by stevech »

liam.zbasic wrote:Free time is very scarce these days with the job and a newborn. Question... are the interface kits available pre-assembled and soldered? If so, what is the delta cost?

Also, I've been programming ZX-40A chips for about a year, and I'm ready to move on to the native devices. I'm happy to see the recent addition of the ZX-328n to wean me off the virtual machine chips. And the price is right too. Regarding the ZX-40n, is there a price reduction for purchasing multiple chips?

Thanks.
Speed aside, the VM chips do have the huge advantage of high code density as compared to native mode.
dlh
Posts: 395
Joined: 15 December 2006, 12:12 PM
Location: ~Cincinnati

Re: Preassembled Interface Kits

Post by dlh »

stevech wrote: Speed aside, the VM chips do have the huge advantage of high code density as compared to native mode.
Is there any way to estimate program storage requirements for VM vs. native code?
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Re: Preassembled Interface Kits

Post by mikep »

You mean other than compiling the code for both? My rough guide would be an estimate of 5 to 1; that is the VM code is 5 times more compact than the native code. However that doesn't tell the whole story.

For the ZVM devices based on mega32/644/644p, the program is stored in a separate EEPROM that can be either 32K or 64K bytes and the ZVM is stored in the device's flash memory. The code for the mega32 devices can sometimes be a little larger than the 644/644p devices because some of the library routines (e.g CStrHex) are implemented as VM instructions.

For the ZVM devices based on the mega128/1281/1280, the program is stored in flash together with the VM implementation and is limited to 58K. The remaining 68K is for the 4K bootloader and the VM runtime. Because the VM instructions are loaded from flash rather than EEPROM, these devices are about 25% faster than the mega32/644/644p ZVM devices.

For native mode devices based on the mega128/1281/1280, 4K is reserved for the bootloader and the remaining 124K can be used for your code. This code is a combination of basic housekeeping routines, library functions from zxLib and your own code. The smallest native mode program is almost 4K bytes for a ZX-128ne and 4.8K bytes for a ZX-1280n.

For native mode devices based on the mega328p, 4K is reserved for the bootloader and the remaining 28K can be used for your code. The smallest native mode program is around 3.5K bytes for the ZX-328n.
Mike Perks
dlh
Posts: 395
Joined: 15 December 2006, 12:12 PM
Location: ~Cincinnati

Re: Preassembled Interface Kits

Post by dlh »

mikep wrote:You mean other than compiling the code for both? My rough guide would be an estimate of 5 to 1; that is the VM code is 5 times more compact than the native code.
I haven't written the code so was looking for a rough guide to help decide whether it might be worth the effort.

There is BasCOM AVR code for the ENC28J60 which, when compiled to machine language, requires about 11K. However, it also calls some functions in a couple of BasCOM object libraries so it's likely to require a bit more even without knowing whether ZBasic will be more or less efficient than BasCOM at generating AVR machine code. I'm trying to get a feel for how much room might be left (using ZX-328n) for my application code.

Is code written in C likely to be more efficient than ZBasic?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Preassembled Interface Kits

Post by dkinzer »

mikep wrote:For native mode devices based on the mega328p, 4K is reserved for the bootloader and the remaining 28K can be used for your code.
The bootloader size is actually 2K leaving 30K for user code.
dlh wrote:Is there any way to estimate program storage requirements for VM vs. native code?
There are too many factors involved to permit even rule-of-thumb estimations. For example, consider the "null program" below that compiles to 18 bytes for the ZX-24a and 3808 bytes for the ZX-24n.

Code: Select all

Sub Main()
End Sub
As a second data point consider the program below: ZX-24a 50 bytes, ZX-24n 3850 bytes.

Code: Select all

Dim i as Integer, j as Integer
Sub Main()
  For i = 1 to 10
	j = i
  Next
End Sub
Of course, the difference depends on the particular instructions used. Compare the data for the sample program below: ZX-24a 53 bytes, ZX-24n 4844 bytes.

Code: Select all

Dim i as Integer
Sub Main()
  For i = 1 to 10
	Debug.Print i
  Next
End Sub
The largest program that I have data for is the code for my machine tool controller comprising about 5300 lines of code and comments. This compiles to 18,070 for the ZX-24a and 30,790 for the ZX-24n. One last data point is for the RoZetta code that I have (dated June 2008). It compiles to 12,332 bytes for the ZX-40a and 40,660 bytes for the ZX-40n.
dlh wrote:Is code written in C likely to be more efficient than ZBasic?"
For any specific routine, probably not. The C code generated from the ZBasic code is, in most cases, pretty much as you would have written it in C yourself so it then comes down to the efficiency of the code generator of the back-end compiler. The code size for a general application that doesn't exploit multi-tasking and doesn't use the RTC is probably going to be larger when written in ZBasic than if it were written in C because of the multi-tasking core infrastructure overhead that is included in every native mode ZBasic program.
- Don Kinzer
dlh
Posts: 395
Joined: 15 December 2006, 12:12 PM
Location: ~Cincinnati

Re: Preassembled Interface Kits

Post by dlh »

dkinzer wrote:One last data point is for the RoZetta code that I have (dated June 2008). It compiles to 12,332 bytes for the ZX-40a and 40,660 bytes for the ZX-40n.
My guesstimate is that this would be about 1/3 that size but this is still looking like I need a much bigger shoehorn. I'll probably write the minimum code I need for the app and see how much space is left for the ENC28J60 code before trying to decide if it's feasible.
For any specific routine, probably not. The C code generated from the ZBasic code is, in most cases, pretty much as you would have written it in C yourself...
Any C code I write would probably be very sloppy - I haven't used C in many years. I was thinking of Fred Eady's C code for the ENC28J60 to replace the BasCOM object files. I can convert the BasCOM .BAS code to ZBasic but do not have source for the object files which were written in ASM.
Post Reply