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
Ethernet?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 03 January 2007, 19:56 PM    Post subject: Ethernet? Reply with quote

Has anyone considered mating a ZX with one of the $20 ethernet modules- one that uses SPI/I2C for the processor interface, and has the MAC on-chip? Not sure how much VM codespace would be needed for ARP, IP and TCP, and perhaps an HTTPd. Perhaps some new chips have the network layers as well as the MAC on-chip.
Back to top
twesthoff



Joined: 17 Mar 2006
Posts: 199
Location: Fredericksburg, VA

Posted: 03 January 2007, 20:06 PM    Post subject: Ethernet? Reply with quote

I bought some modules, but haven't had time to get them working.
The modules I have are based on the IIM7010A. They have hardware support for the common protocols, so programming with them is very much like the "socket" interface common with windows programming. I don't think it would be too hard, but have not done it, yet.
Sorry I can't help more...
Back to top
dkinzer
Site Admin


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

Posted: 03 January 2007, 20:57 PM    Post subject: Re: Ethernet? Reply with quote

stevech wrote:
Has anyone considered mating a ZX with one of the $20 ethernet modules- one that uses SPI/I2C for the processor interface, and has the MAC on-chip?.
I briefly looked at the ENC28J60. The problem with it is that a bug in the chip design manifests at SPI clock rates below 8MHz. The fastest SPI clock available for the ZX is 7.37MHz.
stevech wrote:
Not sure how much VM codespace would be needed for ARP, IP and TCP, and perhaps an HTTPd.

ARP, IP, ICMP and UDP can be implemented fairly easily even with limited RAM use. SNTP via UDP is also fairly easy. DHCP can be done but its packet sizes are larger than the others mentioned so far. TCP is more complicated and more RAM intensive due to session issues.
Back to top
Don_Kirby



Joined: 15 Oct 2006
Posts: 329
Location: Long Island, New York

Posted: 03 January 2007, 21:04 PM    Post subject: Reply with quote

Just yesterday I was exploring the option of using an RS485 bus for a multipoint control project using a bunch of ZX's. As the ethernet interfaces are getting so cheap though, I wonder if I wouldn't be better off using that instead.

I would certainly like to hear from anyone who has had a chance to play around with one.

-Don
Back to top
dlh



Joined: 15 Dec 2006
Posts: 287
Location: ~Cincinnati

Posted: 03 January 2007, 22:08 PM    Post subject: Re: Ethernet? Reply with quote

dkinzer wrote:
I briefly looked at the ENC28J60. The problem with it is that a bug in the chip design manifests at SPI clock rates below 8MHz. The fastest SPI clock available for the ZX is 7.37MHz.
I read recently that newer ENC28J60 chips will work at lower SPI clock rates.

From http://www.amodio.biz/projects/PICDEM2_NIC28/
Quote:
The ENC28J60 due a bug in silicon Revisions B1 and B4 requires a SPI clock (SCK) of at least 8MHz, being 10MHz the maximum. This problem was fixed in the B5 silicon revision where the acceptable range for SCK is from DC to 20MHz.

A workaround for the B1/B4 clock synchronization problem is to use the same clock source for the ENC28J60 and the Microcontroller, for example by using the clock signal provided by the ENC28J60 on the CLKOUT pin. By default CLKOUT output is 6.25MHz (25MHz/4).
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 03 January 2007, 22:42 PM    Post subject: Reply with quote

doing a little surfing the last few days, there seem to be 3 or so $20 ethernet modules with on-chip MAC and, I guess, IP.

I studied the Ethernut code a bit - IP and TCP in C for AVR. It's enough of a mess that I wouldn't want to wade into it - too much time.

So as said earlier, it would be best for the 8 bit micro to not host the IP stack, and that, I guess, is the point of these modules. There's a bunch of PIC activity in ethernet interfaces, but I've just skimmed it.

Would be nice if "someone" (!) would tabulate the available modules by features, cost and which interfaces can work with the existing ZX modules. This has to stay in reason, as the ZX cost + module cost can't get out of wack, since the XPort (and Digi's equivalent) is just $60, and the Tibbo EM202 is in the same range (though Tibbo's VM doesn't support 32 bit ints or floats on the low end modules, only their $80 EM1000). And the WiPort is just $120 (!) - I have one.
Back to top
twesthoff



Joined: 17 Mar 2006
Posts: 199
Location: Fredericksburg, VA

Posted: 04 January 2007, 0:56 AM    Post subject: Re: Ethernet? Reply with quote

I have been studying these for quite a while. I do not claim to know all about them, but I will share what I know.

Xport - I have used this device and it is mainly a serial data (RS-232 at logic levels) to Ethernet converter with general purpose 3 I/O lines. It can also be a simple web server, and can send e-mails to preprogrammed addresses if certain conditions ocur or the I/O lines change. It can do a lot, but you can not send a custom UDP packet or make a custom TCP connection as you might think.

Tibbo - The 202 I have, but can not get it to work. I have e-mailed tech support and I get a response after a few days, but the response is usually not helpful. I suspect there is a language translation issue. It can be programmed with a Basic like language and is very flexible, but not what I expected and the I/O is made for very slow devices.

WizInet - http://www.wiznet.co.kr
Based on the iinChip W3100A or W3150A+ chips.
Features: 10/100 Base-T Ethernet (Auto detection)
Protocol: TCP, UDP, IP, ARP, ICMP, MAC
There is a transparent mode that allows you to write code for any other protocol, or do special stuff.

These modules are the best I have seen and have good hardware support for Internet protocols. It is programmed via a "sockets" style interface and should use a minimum of your program code memory to use it.

The NM7010A (IIM7010A) is the older module based on the W3100A chip and has everything needed including the Ethernet jack on a small module. It can be programmed via I2C and/or a bus style interface.
It is an Internet co-processor with a 16Kbyte buffer memory for received and transmitted ethernet packets. This memory can be accessed by the ZX processor.

The NM7010B+ (Note the "+") is the newer improved version based on the W3150A+ chip. It has some nice features, but for most purposes is similar to the previous version. I would do any new development with the newer version.

You can buy the complete module as above, just the chip, or the NM7000A module that doesn't have the magnetics or the Ethernet jack on it. It is based on the W3100A chip.

The I2C interface uses only a few I/O pins, but is slower. The Bus interface uses about 12 pins and is faster. You have to decide what you need.

I have looked at several other companies products too, such as ASIX AX11005, Microchip, and Maxim/Dallas, but my personal opinion is that the NM7010B+ is the best way to get Ethernet/Internet connectivity with the ZX-Family of processors.

A good source for a NM7010A all set up for I2C interface is:
Easy TCP/IP TWI Adapter Board
http://www.mcselec.com/index.php?option=com_phpshop&page=shop.browse&category_id=22&Itemid=1

The same page has most of the other modules too.

I believe www.saelig.com also sells the modules, but not the Easy TCP/IP TWI Adapter Board.

I hope this helps and look forward to what others out there come up with.
Tom W
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 04 January 2007, 3:41 AM    Post subject: Reply with quote

great - very helpful.
I wrote to Tibbo and asked pre-sales questions like: Will you ever have 32 bit integers in your p-code compiler? Waiting for answer. You said you cannot get the '202 to work: at all? Any clues?

Lantronix XPort - I have access to their restricted developer's web forum - quite a bit of activity. I sense that people are doing elaborate things with Xport and WiPort (same code base). I have a WiPort and have used it but not added code. Both Xport and WiPort now require an (old 16 bit) $100 Borland C compiler. I've studied the C code examples; seems like you can do most anything but the code is pretty mungy/convoluted.

The WizNet looked good to me. Seemed like Mr. BASCOM (MSC Electronics) adds to the WizNet module some sort of interface PCB. Not sure what that board does or adds to the game. If no one has tried this, I might give it a go.
Back to top
dlh



Joined: 15 Dec 2006
Posts: 287
Location: ~Cincinnati

Posted: 04 January 2007, 12:22 PM    Post subject: Re: Ethernet? Reply with quote

twesthoff wrote:
Tibbo - The 202 I have, but can not get it to work. I have e-mailed tech support and I get a response after a few days, but the response is usually not helpful. I suspect there is a language translation issue. It can be programmed with a Basic like language and is very flexible, but not what I expected and the I/O is made for very slow devices.

I also found their tech support to be lacking, I destroyed my first EM202 based on their bad advice. Tibbo is in Taiwan - tech support is in Israel. To me, their online documentation, while voluminous, is difficult to follow in a step-by-step linear fashion.

If your EM202 is not booting properly, unplug and replug the LAN connection while under power. At startup, hold the reset line high for 200mS.

It's also really hard to solder those closely spaced pins without getting solder bridges.

From the factory it should be set up as a device server. You have to download a different VM in order to do your own custom programs.
Back to top
dlh



Joined: 15 Dec 2006
Posts: 287
Location: ~Cincinnati

Posted: 04 January 2007, 12:25 PM    Post subject: Reply with quote

stevech wrote:
The WizNet looked good to me. Seemed like Mr. BASCOM (MSC Electronics) adds to the WizNet module some sort of interface PCB. Not sure what that board does or adds to the game. If no one has tried this, I might give it a go.

BASCOM has a linkable library for the board. It makes programming easy if you're using BASCOM.
Back to top
twesthoff



Joined: 17 Mar 2006
Posts: 199
Location: Fredericksburg, VA

Posted: 04 January 2007, 13:26 PM    Post subject: Re:Ethernet Reply with quote

dlh - Tibbo - I tried all that you mentioned. I can access it via the serial port and downloaded the development stuff to it. It then blinks the LED's the way the manual said it should. I can't get it to be see by their utility program through the ethernet port, so I can't download anything to it. There last e-mail said I should send it back as it might be defective, but that takes a lot of time and money that I don't want to deal with right now, so it is on the back burner. My tech support seemed to come from Taiwan, but my questions were not really answered, just quotes from the manual mostly...

MCS Electronics Easy TCP/IP TWI Adapter Board - You can download the manual and see the schematic. It adds a dip switch and pullup resistors for setting the slave address, a transistor to help with the reset, some bypass caps, and a 3.3V voltage regulator, etc. Just makes it easy to use in I2C mode. It says you only need 4 pins to use it. Nothing that couldn't be done on a breadboard, just easier. The manual also shows another board you can buy that goes with it that will take a Mega32 DIP package... maybe the ZX dip version will work with it?
Tom W
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 689

Posted: 04 January 2007, 13:53 PM    Post subject: Reply with quote

Don_Kirby wrote:
Just yesterday I was exploring the option of using an RS485 bus for a multipoint control project using a bunch of ZX's. As the ethernet interfaces are getting so cheap though, I wonder if I wouldn't be better off using that instead.

I would certainly like to hear from anyone who has had a chance to play around with one.

-Don


Well, Don, It is hard to get cheaper than the $US 0.80 65174-type RS-485 tranciever chip.

The 485 is just the hardware, and then you can use whatever protocol you want. Therefore the protocol can be extremely simple. Or extremely complex and robust. Your decision.

So, the 485 hardware is cheap and you are not FORCED to use any particular protocol simply because you chose a certain type of hardware.

Now, if you NEED to be able to interface with other hardware that might be found on an ethernet network, then it might make sense to incorporate the ethernet hardware despite its complexity.

-Tony
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 04 January 2007, 17:16 PM    Post subject: Re:Ethernet Reply with quote

Quote:
MCS Electronics Easy TCP/IP TWI Adapter Board - You can download the manual and see the schematic. It adds a dip switch and pullup resistors for setting the slave address, a transistor to help with the reset, some bypass caps, and a 3.3V voltage regulator, etc. Just makes it easy to use in I2C mode. It says you only need 4 pins to use it. Nothing that couldn't be done on a breadboard, just easier. The manual also shows another board you can buy that goes with it that will take a Mega32 DIP package... maybe the ZX dip version will work with it?
Tom W


I'm hoping some brave soul will report on how easy it was (!) to get a ZX communicating with TCP and HTTPd to this kind of ethernet module via SPI/I2C.

Tibbo - yes, slick marketing web sites. But where's the beef? They say they'll ship in Feb. a "EM1202" which seems to be the '202 with a faster processor, more memory, perhaps with longs and floats. Said to be same price as the '202. Interesting that their p-code compiler and VM is so much like ZBasic. Maybe Don should offer them a "real" compiler. They do claim to have a nice interactive breakpoint debugger via serial port rather than JTAG. That's kind of unique. I wonder what microprocessor they use?


Last edited by stevech on 04 January 2007, 17:21 PM; edited 1 time in total
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 04 January 2007, 17:20 PM    Post subject: Re:Ethernet Reply with quote

twesthoff wrote:
There last e-mail said I should send it back as it might be defective, but that takes a lot of time and money that I don't want to deal with right now, so it is on the back burner. My tech support seemed to come from Taiwan, but my questions were not really answered, just quotes from the manual mostly.

Did you purchase via their US distributor, ProxID? Or the one in Canada?
Back to top
twesthoff



Joined: 17 Mar 2006
Posts: 199
Location: Fredericksburg, VA

Posted: 04 January 2007, 17:39 PM    Post subject: Re: Ethernet Reply with quote

Tibbo - I bought mine from the Canada distributor, as I could not find a US one that allowed ordering on-line. I bought the development kit. They have not answered ANY of my requests for tech help. Only the factory answers them, usually in 2-3 days, sometimes a week later.

I wanted to use the serialin (not RS-232), but I found out it could only go as fast as about 500Hz which was way too slow for me.
Tom W
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Goto page 1, 2  Next
Page 1 of 2

 


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