|
|
| Author |
Message |
liam.zbasic
Joined: 25 Mar 2008
Posts: 143
Location: Southern California (Blue)
|
|
Posted: 25 January 2009, 18:23 PM Post subject: Preassembled Interface Kits |
|
|
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. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 25 January 2009, 19:18 PM Post subject: Re: Preassembled Interface Kits |
|
|
| 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. |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 26 January 2009, 0:12 AM Post subject: Re: Preassembled Interface Kits |
|
|
| 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. |
|
| Back to top |
|
 |
dlh
Joined: 15 Dec 2006
Posts: 266
Location: ~Cincinnati
|
|
Posted: 27 January 2009, 13:00 PM Post subject: Re: Preassembled Interface Kits |
|
|
| 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? |
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 27 January 2009, 14:15 PM Post subject: Re: Preassembled Interface Kits |
|
|
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. |
|
| Back to top |
|
 |
dlh
Joined: 15 Dec 2006
Posts: 266
Location: ~Cincinnati
|
|
Posted: 27 January 2009, 14:38 PM Post subject: Re: Preassembled Interface Kits |
|
|
| 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? |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 27 January 2009, 16:39 PM Post subject: Re: Preassembled Interface Kits |
|
|
| 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.
As a second data point consider the program below: ZX-24a 50 bytes, ZX-24n 3850 bytes. | Code: | 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: | 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. |
|
| Back to top |
|
 |
dlh
Joined: 15 Dec 2006
Posts: 266
Location: ~Cincinnati
|
|
Posted: 27 January 2009, 16:59 PM Post subject: Re: Preassembled Interface Kits |
|
|
| 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.
| Quote: | | 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. |
|
| Back to top |
|
 |
|