|
Part 2: The Software and Firmware Exposed
by Fred Eady
Start ý The
Basics ý Registers ý Bus
Interface Registers ý Status and Control
Registers ý InitChip ý Initiate
Transmit Registers ý Address Filter Registers
ý Receive and Transmit Frame Locations
ý CS8900A-CQ Transmit and Receive Operations
ý The Next Read ý Broadcast
ý ARP ý No Cheating
ý Tiger Woodsý Putter ý Whatýs
the Point? ý And It Programs, Too!
ý Sources and PDF
NO CHEATING
If youýre reading ahead, and I expect you
are, you already know that the fourth event is unmasked in Photo 8.
You also know it is a UDP transaction between the PC called SPEADY
and the Ethernet development board. Iýve already presented lots of
words on IP protocol in other Circuit Cellar articles. (Is
that a low-down way to get you to read my stuff, or what?) So, Iým
not going to go into detail about what the IP fields mean and do here.
I do want to point out that the Sniffer fields match the PIC IP field
layout in the Ethernet development board code you see in Listing
15.
Photo 9 highlights the DLC-type field
in the hex dump area containing 0800, which signifies an IP frame.
Following the logic in Listing
16, you see that 0806 caused
an ARP replay frame to be built and transmitted, and 0800 sends the
code down the path to process an IP frame. After youýre headed in
the IP frame direction, there are still decisions to be made as to
where the code will branch to next. The protocol field within the
IP header determines that. In Photo 9, the protocol value is 0x11,
or 17 decimal. That means that UDP header information and data is
contained within the IP data area.
 |
Photo 9ýAll this work for
one byte of data! (enlarge) |
The Ethernet development board firmware
examines the UDP destination port to determine how to handle the UDP
data. In this case, the destination is Port 7. When UDP Port 7 is
addressed in the Ethernet development board firmware, an echo operation
is performed. That is, the data, in this case an "a" (0x61),
is echoed back to the source hostýs port 5002. You can see from the
fifth event at the top of Photo 9 that this entails swapping the source
and destination ports, IP addresses, and physical addresses. This
swapped frame is returned to the senderýs UDP port with the UDP data
untouched. Compare Photo 9 and Photo 10 to realize the concept.
 |
Photo 10ýAnd, one byte of data
back to you. (enlarge) |
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |