THE DESIGN CYCLE
■ FIGURE 4. Our 16-bit ported PICBASIC PRO checksum
routines have passed the test as we have now calculated
the IP header and ICMP checksums. Note that the
Network General Sniffer points out that this is an Echo
Reply and references the byte field in the hex dump at
the bottom of the shot. All hail the Network General
PICBASIC PRO UDP code flow as it looks just
like everything we’re mulled over up to now.
Now that we have ported the code that drives
the PIC18F67J60 Ethernet hardware, most of what
we are doing consists of parsing fields of incoming
packets, calculating checksums, and correctly
placing IP and MAC addresses.
When you go over the UDP code, note that
UDP adds yet another concept we must consider in
our code. In addition to an IP and MAC address,
UDP utilizes source and destination port addresses.
The UDP application I’ve supplied in the download
www.nutsvolts.com) looks for a message sent to
well-known port 7, which is the echo port. “Well-known”
means that this is a standardized port. You can use port 7
for other things but you may run into a problem if the other
guy or gal you want to communicate with has used port 7
for its original intended purpose.
I’ve also included the time-tested EDTP Internet Test
Panel application, which runs on a PC. The EDTP Internet
Test Panel application you see in Figure 5 is easy to use. All
you have to do is enter the Ethernet MINI’s IP address in the
Target IP Address window and type characters into the
Original Data window. Ignore the Target Port and LCD Data
Entry windows as they were part of a past EDTP application.
If things work as designed, what you type into the Original
Data window will be echoed by the Ethernet MINI back to
the Echoed Data window in the EDTP Internet Test Panel
STACKING UP THE PROTOCOLS
We’ve worked our way through the coding of the
PIC18F67J60 physical layers. With the completion of this
month’s discussion, we’ve worked our way through the
PICBASIC PRO 32-bit limitation and established a foothold on
the coding of the basic Internet protocols. With the successful
porting of the ARP, ICMP, and
UDP protocols behind us, we
are climbing towards the most
famous protocol: TCP. Next time,
we’ll talk more about UDP and
port the Ethernet MINI DHCP
and TCP C source to PICBASIC
PRO. I’m having a blast coding
with PICBASIC PRO. NV
■ EDTP Electronics, Inc.
Labs, Inc. (www.melabs.
com): PICBASIC PRO
■ FIGURE 5. This application has been
around for a couple of years and has
seen widespread use. It’s simply a tool
that was created to test the functionality
of the UDP firmware written at EDTP
Electronics. All you have to do is dial
in a Target IP Address and start typing.
The Standard for checking
Good enough to be the
choice of Panasonic,
Pioneer, NBC, ABC, Ford,
JVC, NASA and thousands
of independent service
Locate shorted or leaky
components or conditions
to the exact spot in-circuit
Still cutting up the pcb,
and unsoldering every
part trying to guess at
where the short is?
Your DVM shows the same shorted reading all
along the pcb trace. LeakSeeker 82B has the
resolution to find the defective component.
And with a 60 day trial period, satisfaction Touch pads along the trace, and LeakSeeker
guaranteed or money-back policy, the only beeps highest in pitch at the defect’s pad. Now
thing you can lose is all the time you’re you can locate a shorted part only a quarter of
currently spending on trying to repair all an inch away from a good part. Short can be
those dogs you’ve given up on. from 0 to 150 ohms
CapAnalyzer 88A LeakSeeker 82B
Available at your distributor, or call 561-487-6103
Electronic Design Specialists
Inexpensive enough to pay for itself in just
one day’s repairs. At $209, it’s affordable.
September 2007 93