{"id":2439,"date":"2017-09-01T13:35:07","date_gmt":"2017-09-01T04:35:07","guid":{"rendered":"http:\/\/otsuka.biz\/blog1\/?p=2439"},"modified":"2024-02-12T17:07:55","modified_gmt":"2024-02-12T08:07:55","slug":"ethernet-and-usb-board-using-pic18f27j53-and-w5200","status":"publish","type":"post","link":"https:\/\/otsuka.biz\/blog1\/ethernet-and-usb-board-using-pic18f27j53-and-w5200\/","title":{"rendered":"Ethernet and USB board using PIC18F27J53 and W5200"},"content":{"rendered":"<p>Arduino \u306e\u6709\u7dda LAN module \u3068\u3057\u3066\u983b\u7528\u3055\u308c\u3066\u3044\u308b WIZnet \u793e\u306e <a href=\"http:\/\/www.wiznet.io\/product-item\/wiz820io\/\">WIZ820io (W5200)<\/a> \u3092 PIC \u30de\u30a4\u30b3\u30f3\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u5b9f\u9a13\u3092\u884c\u3063\u305f\u3002W5200 \u306f TCP\/IP protocols \u3092\u5185\u90e8\u306b\u5b9f\u88c5\u3059\u308b\u305f\u3081\u3001MCU (Micro Controller Unit) \u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30fb\u30e1\u30e2\u30ea\u8ca0\u62c5\u3092\u8efd\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3042\u308b\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001WIZnet \u793e\u304b\u3089 W5200 \u3092\u7528\u3044\u305f <a href=\"http:\/\/www.microchip.com\/DevelopmentTools\/ProductDetails.aspx?PartNO=TWIZ5200\">Ethernet PICtail Board<\/a> \u304c\u8ca9\u58f2\u3055\u308c\u3066\u3044\u3066\u3001Microchip TCP\/IP Stack \u306b\u8ffd\u52a0\u3059\u308b <a href=\"http:\/\/old.wiznet.co.kr\/microchip\/\">W5200 driver<\/a> \u304c WIZnet \u793e\u306e\u30b5\u30a4\u30c8\u304b\u3089\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u3002\u4eca\u56de\u306e\u76ee\u6a19\u306f\u3001\u65b0\u305f\u306b PIC18F27J53 \u3068 WIZ820io (W5200) \u3067\u69cb\u6210\u3055\u308c\u308b\u5b9f\u9a13\u30dc\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u3001DHCP server \u304c\u5272\u308a\u632f\u308b IP address \u3092\u53d6\u8fbc\u307f\u3001\u66f4\u306b NetBIOS Name Service (NBNS) \u304c\u5229\u7528\u51fa\u6765\u308b\u4e8b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u3067\u3042\u308b\u3002<\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/Ethernet-and-USB-Board-with-W5200.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2481\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/Ethernet-and-USB-Board-with-W5200.jpg\" alt=\"\" width=\"3161\" height=\"2137\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/Ethernet-and-USB-Board-with-W5200.jpg 3161w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/Ethernet-and-USB-Board-with-W5200-300x203.jpg 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/Ethernet-and-USB-Board-with-W5200-768x519.jpg 768w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/Ethernet-and-USB-Board-with-W5200-1024x692.jpg 1024w\" sizes=\"auto, (max-width: 3161px) 100vw, 3161px\" \/><\/a><\/p>\n<p>PIC18F27J53\u00a0\u00a0 &lt;&#8212;\u00a0SPI &#8212;&gt;\u00a0\u00a0\u00a0WIZ820io (W5200)\u00a0\u00a0 &lt;&#8212; Ethernet &#8212;&gt;\u00a0 \u00a0Local area\u00a0network<\/p>\n<p>&lt;&lt; Architecture of\u00a0the Ethernet board &gt;&gt;<\/p>\n<p>The\u00a0Ethernet module, WIZ820io, is connected with the microcontroller, PIC18F27J53,\u00a0using the Serial Peripheral Interface (SPI).<\/p>\n<p>Clock and pin connection of PIC18F27J53 :<\/p>\n<p>The system clock of 48MHz\u00a0is derived from the external ceramic resonator of 4MHz using the PLL module.<\/p>\n<p>LED : RB1, RB2; \u00a0\u00a0 Switch (pull down) :\u00a0MCLR, RB3;<\/p>\n<p>LCD\u00a0(SC1602BBWB-XA-GB-G) :\u00a0RS &#8211; RC6, R\/W &#8211; GND, E &#8211; RB6, Data bus : DB4 &#8211; RB7, DB5 &#8211; RC0, DB6 &#8211; RC1, DB7 &#8211;\u00a0RC2, VDD &#8211; 5 volt<\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/PIC18F27J53-Board-with-W5200.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2483\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/PIC18F27J53-Board-with-W5200.png\" alt=\"\" width=\"968\" height=\"799\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/PIC18F27J53-Board-with-W5200.png 968w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/PIC18F27J53-Board-with-W5200-300x248.png 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/08\/PIC18F27J53-Board-with-W5200-768x634.png 768w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/a><\/p>\n<p>WIZ820io\u00a0:<\/p>\n<p>RESET \u00a0&#8211;\u00a0 PIC pin 4 (RA2)<br \/>\nSS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; \u00a0PIC pin 5 (RA3)<br \/>\nSCLK\u00a0\u00a0 &#8211;\u00a0 PIC pin 25 (RB4\/RP7 assigned to SCK1)<br \/>\nMISO\u00a0\u00a0 &#8211;\u00a0 PIC pin 26 (RB5\/RP8 assigned to SDI1)<br \/>\nMOSI\u00a0 \u00a0&#8211; \u00a0PIC pin 18 (RC7\/RP18 assigned to SDO1)<\/p>\n<p>&lt;&lt; Sample code\u00a0for the\u00a0Ethernet board with W5200\u00a0&gt;&gt;<\/p>\n<div class='w3eden'><!-- WPDM Link Template: Default Template -->\n\n<div class=\"link-template-default card mb-2\">\n    <div class=\"card-body\">\n        <div class=\"media\">\n            <div class=\"mr-3 img-48\"><img decoding=\"async\" class=\"wpdm_icon\" alt=\"\u30a2\u30a4\u30b3\u30f3\" src=\"data:image\/svg+xml;base64,CiAgICAgICAgICAgIDxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNDAgNDAiPgogICAgICAgICAgICAgICAgPGRlZnM+CiAgICAgICAgICAgICAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkaWVudCIgeDE9IjAiIHkxPSIwIiB4Mj0iMCIgeTI9IjEiPgogICAgICAgICAgICAgICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjMjY5ZGVmIiBvZmZzZXQ9IjAiLz4KICAgICAgICAgICAgICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzI2YmRlZiIgb2Zmc2V0PSIxIi8+CiAgICAgICAgICAgICAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgICAgICAgICAgICAgIDwvZGVmcz4KICAgICAgICAgICAgICAgIDxnPgogICAgICAgICAgICAgICAgICAgIDxyZWN0IGZpbGw9InVybCgjZ3JhZGllbnQpIiB4PSIwIiB5PSIwIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHJ4PSIzIiByeT0iMyIvPgogICAgICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjUiIHk9IjE5IiBmb250LWZhbWlseT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxM3B4IiBsZXR0ZXItc3BhY2luZz0iMSIgZmlsbD0iI0ZGRkZGRiI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0c3Bhbj5MWkg8L3RzcGFuPgogICAgICAgICAgICAgICAgICAgICAgICA8dHNwYW4geD0iNiIgeT0iMjgiPl88L3RzcGFuPgogICAgICAgICAgICAgICAgICAgIDwvdGV4dD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9zdmc+CgoJCQk=\" \/><\/div>\n            <div class=\"media-body\">\n                <h3 class=\"package-title\"><a href='https:\/\/otsuka.biz\/blog1\/download\/ethernet_pic18f27j53_w5200\/'>Ethernet_PIC18F27J53_W5200<\/a><\/h3>\n                <div class=\"text-muted text-small\"><i class=\"fas fa-copy\"><\/i> 1 \u30d5\u30a1\u30a4\u30eb <i class=\"fas fa-hdd ml-3\"><\/i> 1.00 MB<\/div>\n            <\/div>\n            <div class=\"ml-3\">\n                <a class='wpdm-download-link download-on-click btn btn-primary ' rel='nofollow' href='#' data-downloadurl=\"https:\/\/otsuka.biz\/blog1\/download\/ethernet_pic18f27j53_w5200\/?wpdmdl=3389&refresh=69e92781e6e461776887681\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div>\n<p>(Compiled by\u00a0the C18 under\u00a0the large code model\u00a0on the\u00a0MPLAB X IDE)<\/p>\n<p>In TCPIPConfig.h, STACK_USE_DHCP_CLIENT, STACK_USE_NBNS and STACK_USE_TCP\u00a0have been\u00a0defined in this project.\u00a0 Consequently, the test board can practice the communications-protocol of DHCP Client and NBNS.<\/p>\n<p>The default network configuration in TCPIPConfig.h\u00a0must be adjusted to your local network (MAC address, IP\u00a0address and so on).<\/p>\n<p>Example above:<br \/>\nNetBIOS Name = PIC18F27J53<br \/>\nDefault MAC address = {0x00, 0x04, 0xA3, 0x00, 0x00, 0x00}<br \/>\nDefault IP address\u00a0 = 192.168.1.10<br \/>\nDefault subnet mast = 255.255.255.0<br \/>\nDefault primary DNS = 192.168.1.1<br \/>\nDefault secondary DNS = 0.0.0.0<\/p>\n<p>The connection to the Ethernet board can be checked by the ping on the Command Prompt of your Windows PC.<\/p>\n<p>&lt;&lt; Summary in Japanese &gt;&gt;<\/p>\n<p>\u4eca\u56de\u306e\u5b9f\u9a13\u306b\u7528\u3044\u305f WIZnet \u793e\u306e <a href=\"http:\/\/old.wiznet.co.kr\/microchip\/\">W5200 hardwired TCP\/IP driver<\/a> \u306b\u306f\u82e5\u5e72\u306e\u624b\u76f4\u3057\u304c\u5fc5\u8981\u3067\u3042\u3063\u305f\u3002<\/p>\n<p>\u73fe\u6642\u70b9\u3067\u306e\u8cbb\u7528\u5bfe\u52b9\u679c\u3092\u554f\u308f\u308c\u308c\u3070\u3001WIZ820io\uff08W5200\u642d\u8f09\u30e2\u30b8\u30e5\u30fc\u30eb\uff09\u3088\u308a ENC28J60 Ethernet LAN Network Module For Arduino SPI AVR PIC LPC STM32 \u306b\u8ecd\u914d\u304c\u4e0a\u304c\u308b\u3068\u7b54\u3048\u308b\u3002\u306a\u305c\u306a\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306f\u7d20\u4eba\u3067\u63d0\u4f9b\u3055\u308c\u305f firmware \u3092\u4f7f\u3046\u3060\u3051\u3060\u304b\u3089\u3001performance \u3092\u8a55\u4fa1\u3059\u308b\u8cc7\u8cea\u306f\u5099\u3048\u305a\u3001hobby-use \u3067\u306e cost \u9762\u3067\u3057\u304b\u8a55\u4fa1\u3067\u304d\u306a\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arduino \u306e\u6709\u7dda LAN module \u3068\u3057\u3066\u983b\u7528\u3055\u308c\u3066\u3044\u308b WIZnet \u793e\u306e WIZ820io (W5200) \u3092 PIC \u30de\u30a4\u30b3\u30f3\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u5b9f\u9a13\u3092\u884c\u3063\u305f\u3002W5200 \u306f TCP\/IP protocol [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-2439","post","type-post","status-publish","format-standard","hentry","category-pic","category-test-board-of-pic","category-internet"],"_links":{"self":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/2439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/comments?post=2439"}],"version-history":[{"count":2,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/2439\/revisions"}],"predecessor-version":[{"id":3390,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/2439\/revisions\/3390"}],"wp:attachment":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/media?parent=2439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/categories?post=2439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/tags?post=2439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}