Ads 468x60px

Senin, 09 Juli 2012

WIZnet Serial to Ethernet Gateway with PIC Microcontroller

By Idris Zainal Abidin

This is article from one of electronics amateur, experience in embedded design and programming. He has utilize the BPS-5-3 breadboard power stick, LC04A Logic Level Shifter and WIZnet Serial to Ethernet Gateway, to show the basic interface between WIZnet gateway, Graphic LCD, PIC microcontroller and the setup.



Main Components:

1. WIZnet Serial-to Ethernet Gateway.

2. PIC16F688 Microcontroller.

3. Breadboard GL-12 (C&D).

4. Breadboard Power Stick 5V 3V3.

5. Logic Converter 4 Channels.

6. 5110 Nokia LCD.

clip_image002

Software Required:

1. MPLAB X IDE V1.20

2. MPLAB XC8 Compiler

*PIC source code is provided, you can download in under attachment at bottom of this article.

Schematic Diagram:

clip_image004

From the schematic diagram,

  • PIC and WIZnet module needs 5V
  • 5110 Nokia LCD needs 3.3V
  • Logic Converter needs 5V and 3.3V

By using the Cytron’s Breadboard Power Stick 5V 3V3, I have save my time and the breadboard space. J

This module provides the DB9 connector/RS232 communication, so you need the MAX232 chip to communicate. I don’t want to use it (MAX232) because I don’t have it. At the underside of this module, there have J2, J3, J4 and J5. Those pins represent 5V (J2), GND (J3), TX (J4) and RX (J5). We can use it but we need a logic converter because the TX and RX pins are low voltage TTL (3.3V) and Cytron’s Logic Converter 4 Channels is really helpful. J

clip_image006

clip_image008

Setup WIZnet Serial-to-Ethernet Gateway using Configuration Tools Software:

You can find the download link here: http://www.cytron.com.my/viewProduct.php?pcode=WIZ110SR&name=WIZnet%20Serial-to-Ethernet%20Gateway

clip_image010

  • Launch the WIZ1x0SR_105SR_CFG_V3_0_2.exe and connect the WIZnet module using LAN cable and don’t forget the 5V supply.
  • Click ‘Search’. It should find your device and you will be able to configure its IP address, port, and whether you want to use TCP or UDP.

clip_image012

clip_image014

  • In Network tab, set your ‘Local IP’, ‘Subnet’, ‘Gateway’ and ‘Server IP’ include the ‘Port’ number. Uncheck the ‘Use UDP mode’ because we want to use the TCP/IP mode.
  • In Serial tab, set the baudrate ‘Speed’, ‘DataBit’, ‘Parity’, ‘Stop Bit’ and ‘Flow’ as shown in the figure below.

clip_image016

  • In Option tab, just follow the setting below. There have ‘Data Packing Condition’ that you can play with, but for now just make it simple setting.

clip_image018

  • After you have done all the settings, click ‘Setting’ to complete the WIZnet module configurations.

clip_image020

clip_image022

  • Ok, you have done the setting for your WIZnet module. Now you need to set your PC. Open ‘Internet Protocol’ and set the ‘IP address’, ‘Subnet mask’ and ‘Default gateway’ as follow – Click OK.
  • Open HyperTerminal and write connection ‘Name’ – Click OK.
  • Choose ‘Connect using’ TCP/IP (Winsock), then set ‘Host address’ and ‘Port number’ – Click OK.

clip_image024clip_image026

A. This is the flow of firmware programming. Once the board is powered up, LCD will display the Welcome note. It will wait until the SW (input RA4) is pressed.

clip_image028

B. After SW is pressed, data is transferred from PIC to PC through WIZnet module using TCP/IP protocol. HyperTerminal displays all the data receive. In LCD site, it displays ‘Receive:’ as shown below.

clip_image030clip_image032

C. You can write any characters and it will transfer the data to WIZnet – PIC. Once receive, LCD will displays the data.

clip_image034clip_image036

That’s all. Thank you :)

Tidak ada komentar:

Posting Komentar