Ethernet connectivity
Ethernet connectivity
I am about 2/3 completed on writing the Ethernet drivers for a Realtek RTL8019AS controller. This allows for a 10MB ethernet connection to a local network and/or the Internet. I have successfully implemented the ARP (hardware address resolution), ICMP (Ping response), UDP, and TCP/IP telnet server on a basic level. I was able to telnet into my SBC computer from the Internet. I am also working on an HTTP server implementation. I still want to add FTP server code to round out the package.
So far, I've used about 4k of memory. To get where I want it to be, will require about 6-8k, including buffer memory.
My question is, if you wanted to add ethernet to your system, would you prefer to let the 6502 do the work, or would it be desireable to let a dedicated controller handle the low level stuff and just let the 6502 pass control commands and the high level data.
The advantages include less memory needed and less processor time spent handling all the low-level protocols.
The disavantages include interfacing the controller and creating the control command structure, and the complexity of having multiple processors in your sytem.
Not to mention some just don't want non-6502 processors in their system (I was considering an AVR in this case).
What do ya think?
Daryl
So far, I've used about 4k of memory. To get where I want it to be, will require about 6-8k, including buffer memory.
My question is, if you wanted to add ethernet to your system, would you prefer to let the 6502 do the work, or would it be desireable to let a dedicated controller handle the low level stuff and just let the 6502 pass control commands and the high level data.
The advantages include less memory needed and less processor time spent handling all the low-level protocols.
The disavantages include interfacing the controller and creating the control command structure, and the complexity of having multiple processors in your sytem.
Not to mention some just don't want non-6502 processors in their system (I was considering an AVR in this case).
What do ya think?
Daryl
Re: Ethernet connectivity
8BIT wrote:
My question is, if you wanted to add ethernet to your system, would you prefer to let the 6502 do the work, or would it be desireable to let a dedicated controller handle the low level stuff and just let the 6502 pass control commands and the high level data.
Dedicated processors are great when you're looking at a well-defined interface of some kind. However, as soon as you operate outside the scope of that interface, you start running into protocol-related problems.
For the Kestrel, I was going to let the CPU manage the Ethernet interface.
There is a lot of steps to receiving, verifying checksums, decoding packet types, capturing actual data payloads, configuring responses, forming outgoing packets, etc. If you are only running a single application, then using the 6502/65816 to do all of the manipulation won't be a problem as you'll be waiting for the data payload either way.
However, if you are trying run multiple tasks, and only one is working with the ethernet, then you'll be slowing down the other tasks and/or slowing down the data throughput by using the 6502.
Me personally, I hope to have a system that can focus on the task/tasks at hand and not get burried in the low-level manipulation of I/O devices.
For example: Creating the "SBC web server". Now, on top of processing ethernet I/O, you'll have to access a good-sized file system. If we have the 6502/65816 do all of the low level ethernet I/O and the low level storage system I/O, will there be any time left to process some external stimuli that might be used in our web pages? Home automation/security monitoring/status reporting/etc applications where you want to use the Internet to access your system without needing an entire PC running 24/7.
Anyhow... I am currently working on the ethernet I/O and FAT16/32 support for compact flash storage. By using an AVR to handle the low level I/O, I can allow the 6502/65816 to spend more time processing the data collected by the various I/O sources.
The AVR's provide such resources as UART/SPI/I2C/ADC/PWM/general purpose I/O that make them ideal for data collection. The 6502 is better suited to perform the manipulation of the data and control the flow.
Thats my thinking....
Daryl
However, if you are trying run multiple tasks, and only one is working with the ethernet, then you'll be slowing down the other tasks and/or slowing down the data throughput by using the 6502.
Me personally, I hope to have a system that can focus on the task/tasks at hand and not get burried in the low-level manipulation of I/O devices.
For example: Creating the "SBC web server". Now, on top of processing ethernet I/O, you'll have to access a good-sized file system. If we have the 6502/65816 do all of the low level ethernet I/O and the low level storage system I/O, will there be any time left to process some external stimuli that might be used in our web pages? Home automation/security monitoring/status reporting/etc applications where you want to use the Internet to access your system without needing an entire PC running 24/7.
Anyhow... I am currently working on the ethernet I/O and FAT16/32 support for compact flash storage. By using an AVR to handle the low level I/O, I can allow the 6502/65816 to spend more time processing the data collected by the various I/O sources.
The AVR's provide such resources as UART/SPI/I2C/ADC/PWM/general purpose I/O that make them ideal for data collection. The 6502 is better suited to perform the manipulation of the data and control the flow.
Thats my thinking....
Daryl
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
The 6502 SBC I'm working on at the moment will have a co-processor to manage its ethernet. I didn't thing my 1Mhz processor was up to it so I'm using 18F pic at 40Mhz.
I'm trying out the Microship SPI based ethernet adapter chip ENC28J60 (on an EDTP breakout board).
I'm trying out the Microship SPI based ethernet adapter chip ENC28J60 (on an EDTP breakout board).
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
8BIT wrote:
There is a lot of steps to receiving, verifying checksums, decoding packet types, capturing actual data payloads, configuring responses, forming outgoing packets, etc. If you are only running a single application, then using the 6502/65816 to do all of the manipulation won't be a problem as you'll be waiting for the data payload either way.
IP isn't hard to manage if you factor your code correctly. BSD sockets is not an example of what I'd call "well factored." See the uIP stack for an example, non-sockets-derived TCP/IP stack that also supports UDP, and does so quite efficiently.
Quote:
However, if you are trying run multiple tasks, and only one is working with the ethernet, then you'll be slowing down the other tasks and/or slowing down the data throughput by using the 6502.
Quote:
Me personally, I hope to have a system that can focus on the task/tasks at hand and not get burried in the low-level manipulation of I/O devices.
Quote:
For example: Creating the "SBC web server". Now, on top of processing ethernet I/O, you'll have to access a good-sized file system. If we have the 6502/65816 do all of the low level ethernet I/O and the low level storage system I/O, will there be any time left to process some external stimuli that might be used in our web pages?
1) Ethernet has the capacity to swamp the processor, no matter what -- EVEN IF you use an external, dedicated controller. So, no matter what is going to happen, your CPU is going to be too sluggish to keep up with a 10Mbps solid transfer rate. Packets WILL get dropped. Guaranteed.
2) You can cache frequently accessed files in a RAM disk, thus significantly dropping your filesystem I/O costs. Look to how Forth manages its screens for an example -- it very closely mimics how 32-bit processors with paging MMUs works, only it does it in software. I would like to note that besides relying on native OS file caching capabilities, many web servers will actually do their own caching of content as well. Modern web servers are more I/O bound than you think!
Quote:
Anyhow... I am currently working on the ethernet I/O and FAT16/32 support for compact flash storage. By using an AVR to handle the low level I/O, I can allow the 6502/65816 to spend more time processing the data collected by the various I/O sources.
Quote:
The AVR's provide such resources as UART/SPI/I2C/ADC/PWM/general purpose I/O that make them ideal for data collection. The 6502 is better suited to perform the manipulation of the data and control the flow.
Remember too that the application you're designing doesn't sound like it's the kind that you'd want to have slashdotted. That is, it sounds like only 2 maybe 3 people at most would ever be interested in the data it provides. Hence, 2 to 3 concurrent accesses ought to be trivial for the system to handle, with or without TCP/IP header management in software.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
kc5tja wrote:
It sounds to me like you've already made up your mind then, and I have to question why you bothered asking in the first place.
section http://www.6502.org/forum/viewtopic.php?t=821
I learned a whole new approach to that because someone asked a question.
Quote:
Although FAT is pretty simple, you ARE aware that you are allowed to use other filesystems on the storage media, right? If you're going to spend the time to optimize the software and/or dedicated controller, you might as well optimize the choice of filesystem as well. Or create your own as the case may be.
Granted, using a simpler file system might be advantageous and drivers could be written to allow other systems to read it. This might be best asked in a new topic.
Thanks for your inputs...I am grateful for everyone's ideas and comments.
Daryl
8BIT wrote:
kc5tja wrote:
It sounds to me like you've already made up your mind then, and I have to question why you bothered asking in the first place.
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
Re: Ethernet connectivity
8BIT wrote:
I am about 2/3 completed on writing the Ethernet drivers for a Realtek RTL8019AS controller.
Joachim
I prefer assembly language, too.
You might found some interesting information about inserting the Realtec 8019 into microcontroller designs at:
http://www.cornelius-consult.de/index.p ... 4&lang=eng
I hope, you will let us know about your progress.
Joachim
You might found some interesting information about inserting the Realtec 8019 into microcontroller designs at:
http://www.cornelius-consult.de/index.p ... 4&lang=eng
I hope, you will let us know about your progress.
Joachim
-
leeeeee
- In Memoriam
- Posts: 347
- Joined: 30 Aug 2002
- Location: UK
- Contact:
Re: Ethernet connectivity
8BIT wrote:
I am about 2/3 completed on writing the Ethernet drivers for a Realtek RTL8019AS controller.
Quote:
I have successfully implemented the ARP (hardware address resolution), ICMP (Ping response),
Quote:
I am also working on an HTTP server implementation. I still want to add FTP server code to round out the package.
Quote:
My question is, if you wanted to add ethernet to your system, would you prefer to let the 6502 do the work, or would it be desireable to let a dedicated controller handle the low level stuff and just let the 6502 pass control commands and the high level data.
Quote:
The advantages include less memory needed and less processor time spent handling all the low-level protocols.
Quote:
What do ya think?
Lee.
Re: Ethernet connectivity
leeeeee wrote:
Good luck with that, I did it in EhBASIC and it was a needy beast. I much prefer the 3Com 3C509 as, once you've got it going, it's far less demanding on the CPU.
Quote:
Isn't it good when you get your first ping response? 8^)=
Quote:
WINS is also a good protocol to add, then you can give each device a name and do things like PING <name> instead of PING <IPaddress>
Quote:
I'd let the 6502 decide what to do with the packets and have the ethernet controller just buffer the packets in and out, which is more or less what the 3Com cards do for you.
Quote:
The 6502 is quite capable of handling a fair ammount of traffic via ethernet, my Vic 20 can keep up with serving web pages to one machine while responding to pings from over 150 tasks on seven other machines (works out to about 15KB/second).
Quote:
I think you're quite mad, but then I've done it twice already so who am I to judge?
Code: Select all
main LDA buffer, y ; get
MAD ; calc checksum, process packet, and respond
JMP main
MAD exists only on the 6507 and 6509 processors. The 6502 never had it, and the 6510 replaced it with the much less useful SAX instruction. However, it made a kind-of comeback in the 65802 and 65816 processors; WDM is actually the new name for the same basic functionality, though suitably enhanced to take advantage of the 16-bit capabilities of the processor.
Contrary to popular belief, the WDM name is not the initials of the CEO of Western Design Center. It is actually a typo for its true name, DWM, which stands for Do What I Mean. WDM is retained for backward compatibility with earlier assemblers.
Contrary to popular belief, the WDM name is not the initials of the CEO of Western Design Center. It is actually a typo for its true name, DWM, which stands for Do What I Mean. WDM is retained for backward compatibility with earlier assemblers.