Porting the AN2120/D UDP/IP Code to the Avnet Evaluation Board

Porting the AN2120/D UDP/IP Code to the Avnet Evaluation Board

Freescale Semiconductor, Inc. Engineering Bulletin EB390/D 5/2002 Porting the AN2120/D UDP/IP Code to the Avnet Evaluation Board By: Steven Torres . Motorola . SPS TSPG 8-/16-Bit Division c n I , Introduction r o t The Motorola application note Connecting an M68HC08 Family Microcontroller c to an Internet Service Provider (ISP) Using the Point-to-Point Protocol u (AN2120/D) describes a methodology for connecting a Motorola d microcontroller to the Internet using the PPP protocol to exchange UDP/IP n data. UDP/IP (user datagram protocol/Internet protocol) is similar to TCP/IP, o except that being a connectionless protocol, it sends messages to a host c i without establishing a connection. m AN2120/D also includes the code that implements a UDP/IP protocol. This e code was first developed using the Cosmic development environment. Since S then, the UDP/IP code has been ported to Metrowerks CodeWarrior 1 e development environment and onto the 68HC908GP32 Avnet evaluation l board. a c The UDP/IP methodology provides a mechanism to allow a remote device, in s this case an M68HC08 Family microcontroller, to connect to an ISP. When the e remote device has established a connection with the ISP, the remote device e r can broadcast data to other hosts on the Internet. The UDP/IP network F connectivity is illustrated in Figure 1. 1. CodeWarrior is a registered trademark of Metrowerks, a Motorola company. © Motorola, Inc., 2002 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. EB390/D BACKBONE ROUTER MC68HC908GP32 SYSTEM MODEM INTERNET POINT-TO-POINT CONNECTION ROUTER OF LOCAL ISP . c n I , DESTINATION HOST r o Figure 1. Network Framework t c Porting Overview This engineering bulletin describes the porting of the UDP/IP CodeWarrior u code to the Avnet evaluation board. The information provided in subsequent d n sections is organized as a guide to connecting Motorola microcontrollers to the o Internet using the UDP/IP code. c i The demo’s objectives are: m • Connecting an Avnet evaluation board running a CodeWarrior version of e the UDP/IP code on its MC68HC908GP32 MCU to a dial-up server S through a PPP link e • Demonstrating how an ActiveX component can be used as a l destination host to interface with the device running the UDP/IP code a through a dial-up server c s NOTE: This engineering bulletin does not detail the SLIP connection already described e in AN2120/D. e r In subsequent sections, this engineering bulletin describes: F • The Avnet evaluation board hardware • UDP/IP CodeWarrior code modifications that are required for the demo • How to organize, set up, and configure a network to be compatible with a PPP connection • Setting up an ActiveX interface on the destination host to interface with the remote device • Some techniques and tools for debugging an Internet connection between an MCU and a destination host 2 Porting the AN2120 Code to the Avnet Evaluation Board MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. EB390/D Avnet Evaluation Board Setup While this engineering bulletin details using a dial-up server and a subnet to connect a device to a remote host, the UDP/IP code is not limited to this type of connectivity. Variations to this implementation are possible with the correct setup. Application note AN2120/D describes a device, for example, that connects to an ISP, which then allows the device to reach a destination host across the Internet. Demo Development As discussed above, the UDP/IP code can be modified and compiled within the Environment CodeWarrior environment. To program the Avnet evaluation board, the P&E FLASH Programmer can be used. The networking part of the demo was developed and tested using an . . IBM-compatible PC running these Microsoft programs1: c n • Windows 98 SE I • FrontPage 2000 , r • Internet Explorer 5.5 o t • Dial-Up Networking c • Dial-Up Server u d • Winsock version 6 ActiveX component n o The Windows networking setup described below should also be compatible c with Windows 95, 98, NT , and 2000. i m e Avnet Evaluation Board Setup S e Before setting up and configuring the network for the demo, the Avnet board l must be modified to be compatible with the application note AN2120/D a c hardware requirements. In addition, the Avnet board must also be configured s with the correct clock and PLL settings for the demo by setting some jumpers e and switches on the board. e r F 1. Microsoft, Windows, Frontpage, ActiveX, and NT are registered trademarks of Microsoft Corporation in the United States and/or other countries. MOTOROLA Porting the AN2120 Code to the Avnet Evaluation Board 3 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. EB390/D Avnet Evaluation Modifications to the Avnet evaluation board are required so that the Avnet Board Modifications evaluation board will be wired as dictated by application note AN2120/D — see the serial port schematic Figure 2 for the AN2120/D hardware requirements. This schematic can also be found on page 46 of the application note AN2120/D. These wiring requirements are a consequence of the coding of the UDP/IP protocol. U2 MAX220 1 16 C1+ V C5 CC C7 0.1 µF 3 2 0.1 µF C1– V+ 4 6 C2+ V– C8 C6 0.1 µF P1 . µ 0.1 F 5 15 5 . C2– GND 9 . GND 11 14 4 T1In T1Out 8 c 12 R1 R2 8 3 Out In 7 n 9 T2 7 2 I R2Out Out 6 10 R1 13 1 , T2In In r CONNECTOR o DB9 t Figure 2. AN2120/D Serial Port Schematic c u d n Comparing the AN2120/D schematic to the schematic for an Avnet evaluation o board, it is evident that the Avnet board lacks two serial port hardware-wiring c connections. (See Figure 3 below. Please reference the Avnet i ADS-MOT908GP32 for more detailed schematics.) Table 1 summarizes the m schematic observations. The table shows that the unmodified Avnet board e lacks CD and DTR signals. S e l V U1 CC a ADM202 CONNECTOR DB9 c P1 16 15 5 s C1 1 VCC GND 1 9 e µ C2 4 0.1 F 2 2 2 8 6 0.1 µF V+ V– e 3 7 r 1 C1P C2+ 4 2 1 1 C4 6 F C3 0.1 µF 1 0.1 µF 2 3 5 2 C1– C2– CONNECTOR DB9 11 14 P2 T1In T1Out 5 9 PTE0 10 7 4 T2In T2Out 8 3 12 13 7 R1Out R1In 2 6 PTE1 9 8 1 R2Out R2In Figure 3. Avnet Serial Ports Schematic 4 Porting the AN2120 Code to the Avnet Evaluation Board MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. EB390/D Avnet Evaluation Board Setup Table 1. Serial Port Wiring Pin AN2120/D Unmodified Modified Pin Description Requirements Avnet Avnet 3 Rx (= R2) PTE1 PTE1 PTE1 2 Tx (= T2) PTE0 PTE0 PTE0 1 CD (= R1) PTD1 Lacking PTD1 4 DTR (= T1) PTD0 Lacking PTA0 . Table 1 also shows the required signal-to-port serial communication wiring . modifying the Avnet board. The modifications are described in more detail c below. Item 1 resolves the carrier detect (CD) wiring requirements; Item 2 n resolves the data terminal ready (DTR) requirements. Layout schematics of an I unmodified and a modified Avnet board are provided in Figure 4 and Figure 5, , r respectively. o t Modifications: c u 1. Jumpered user interface pin PTD1 (that is Avnet board JP1 pin 9) to d resistor/diode clamp to the Avnet user serial port (PT2) pin 1 n 2. Jumpered the Avnet monitor mode serial port (PT1) pin 2 to the Avnet o user serial port (PT2) pin 4 c i NOTE: The item 2 modification, the DTR resolution, uses a different signal wire than m expected by the UDP/IP code (PTA0 instead of PTD0) and will dictate a e modification in the UDP/IP code. This modification is described in the section S entitled UDP/IP CodeWarrior Code Modifications. e l a c s e e r F MOTOROLA Porting the AN2120 Code to the Avnet Evaluation Board 5 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. EB390/D POT POWER LED LCD CONTRAST DS2 POWER DIP LCD CHARACTER DISPLAY SWITCH JACK SPSI 1 x 16 10 pos LED TEMP SENSOR 1 DS1 JP3 JP1 1 . HC908GP32 . J2 . J1 c SW4 SW1 SW2 DB9 FEMALE DB9 FEMALE 1 A0/MMODE SCOISER n I RESET , SPEAKER OUTPUT r Note: This drawing shows general placement only and is not meant as a mechanical representation of the o actual board. t c Figure 4. Unmodified Avnet Board Layout u d POT n POWER LED o LCD CONTRAST c DS2 i POWER DIP LCD CHARACTER DISPLAY SWITCH JACK m SPSI 1 x 16 e 10 pos S e LED l TEMP a SENSOR 1 DS1 JP3 c JP1 s 1 e HC908GP32 PIN 2 PIN 1 PIN 4 J2 e r J1 SW4 SW1 SW2 DB9 FEMALE DB9 FEMALE F 1 A0/MMODE SCOISER RESET SPEAKER OUTPUT PT1 PT2 +5 V 100 kΩ Note: This drawing shows general placement only and is not meant as a mechanical representation of the actual board. Figure 5. Modified Avnet Board Layout 6 Porting the AN2120 Code to the Avnet Evaluation Board MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    28 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us