{"id":1822,"date":"2017-04-23T09:33:18","date_gmt":"2017-04-23T00:33:18","guid":{"rendered":"http:\/\/otsuka.biz\/blog1\/?p=1822"},"modified":"2024-02-12T16:32:46","modified_gmt":"2024-02-12T07:32:46","slug":"ethernet-board-equipped-with-pic18f27j53-and-enc28j60","status":"publish","type":"post","link":"https:\/\/otsuka.biz\/blog1\/ethernet-board-equipped-with-pic18f27j53-and-enc28j60\/","title":{"rendered":"Ethernet and USB board using PIC18F27J53 and ENC28J60"},"content":{"rendered":"<p>&lt;&lt; Introduction in Japanese &gt;&gt;<\/p>\n<p>\u30ef\u30f3\u30c1\u30c3\u30d7\u30de\u30a4\u30b3\u30f3\u3092\u7528\u3044\u305f\u5b9f\u9a13\u7bc4\u56f2\u3092\u5e83\u3052\u308b\u305f\u3081\u306b\u3001\u4eca\u56de\u306f\u30a4\u30fc\u30b5\u30fc\u30cd\u30c3\u30c8\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u5b9f\u9a13\u30dc\u30fc\u30c9\u3092\u5236\u4f5c\u3057\u305f\u3002\u30a4\u30fc\u30b5\u30fc\u30cd\u30c3\u30c8\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc ENC28J60 \u3092 PIC18F27J53 \u3067\u5236\u5fa1\u3059\u308b\u3002\u66f4\u306b\u62e1\u5f35\u6027\u3092\u9ad8\u3081\u308b\u70ba\u306b USB device \u3068\u3057\u3066\u306e\u30b3\u30cd\u30af\u30bf\u3082\u5b9f\u88c5\u3055\u305b\u305f\u3002<\/p>\n<p>\u53c2\u8003\u66f8\u306f PIC\u3067\u697d\u3057\u3080\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\uff08\u6280\u8853\u8a55\u8ad6\u793e\uff09\u3001TCP\/IP \u30b9\u30bf\u30c3\u30af\u306f Microchip Libraries for Applications v2013-06-15 \u3092\u7528\u3044\u305f\u3002<\/p>\n<p>\u5b9f\u9a13\u30dc\u30fc\u30c9\u306e\u52d5\u4f5c\u78ba\u8a8d\u306f\u3001DHCP server \u304b\u3089\u4ed8\u4e0e\u3055\u308c\u308b\u30ed\u30fc\u30ab\u30eb IP \u30a2\u30c9\u30ec\u30b9\u3092 LCD \u306b\u8868\u793a\u3055\u305b\u308b\u4e8b\u3068\u3001Windows \u30d1\u30bd\u30b3\u30f3\u306e\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089 ping \u304c\u901a\u3063\u3066\u3044\u308b\u304b\u3067\u691c\u8a3c\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/Ehernet-and-USB-board.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1878\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/Ehernet-and-USB-board.jpg\" alt=\"\" width=\"3369\" height=\"2289\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/Ehernet-and-USB-board.jpg 3369w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/Ehernet-and-USB-board-300x204.jpg 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/Ehernet-and-USB-board-768x522.jpg 768w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/Ehernet-and-USB-board-1024x696.jpg 1024w\" sizes=\"auto, (max-width: 3369px) 100vw, 3369px\" \/><\/a><\/p>\n<p>PIC18F27J53\u00a0\u00a0 &lt;&#8212;\u00a0SPI &#8212;&gt;\u00a0\u00a0 ENC28J60\u00a0\u00a0 &lt;&#8212; Ethernet &#8212;&gt;\u00a0\u00a0 Local area\u00a0network<\/p>\n<p>(TCP\/IP protocols are included in the application code\u00a0for the PIC18F27J53.)<\/p>\n<p>&lt;&lt; Architecture of\u00a0the Ethernet board &gt;&gt;<\/p>\n<p>The\u00a0Ethernet controller, ENC28J60, 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\/04\/PIC18F27J53-Board-e1500536236118.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2432\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/PIC18F27J53-Board-e1500536236118.png\" alt=\"\" width=\"968\" height=\"1086\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/PIC18F27J53-Board-e1500536236118.png 968w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/PIC18F27J53-Board-e1500536236118-267x300.png 267w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/PIC18F27J53-Board-e1500536236118-768x862.png 768w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/PIC18F27J53-Board-e1500536236118-913x1024.png 913w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/a><\/p>\n<p>(Reproduced from the figure in <a href=\"http:\/\/www.picfun.com\/ENC28J60frame.html\">the site of reference<\/a>)<\/p>\n<p>ENC28J60 :<\/p>\n<p>Pin 4 INT\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; Open (Out of use)<br \/>\nPin 6 SO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; PIC pin 26 (RB5\/RP8 assigned to SDI1)<br \/>\nPin 7 SI\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; PIC pin 18 (RC7\/RP18 assigned to SDO1)<br \/>\nPin 8 SCK\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; PIC pin 25 (RB4\/RP7 assigned to SCK1)<br \/>\nPin 9 CS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; PIC pin 5\u00a0\u00a0 (RA3)<br \/>\nPin 10\u00a0RESET &#8211;\u00a0Open (Internally pulled-up to VDD)<\/p>\n<p>&lt;&lt; Sample code\u00a0for the\u00a0Ethernet board\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_enc28j60\/'>Ethernet_PIC18F27J53_ENC28J60<\/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> 941.57 KB<\/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_enc28j60\/?wpdmdl=3375&refresh=69de2189486f01776165257\">\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_ICMP_SERVER, STACK_USE_DHCP_CLIENT and STACK_USE_NBNS\u00a0have been\u00a0defined in this project.\u00a0 Consequently, the test board can practice the communications-protocol of ICMP, ARP, 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 gateway = 192.168.1.1<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;\u00a0Reference &gt;&gt;<\/p>\n<p>TCP\/IP\u00a0stack :\u00a0Microchip Libraries for Applications v2013-06-15.<\/p>\n<p><a href=\"http:\/\/gihyo.jp\/book\/2008\/978-4-7741-3617-2\">PIC\u3067\u697d\u3057\u3080\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<\/a>\uff08Tetsuya Gokan:\u00a0Gijutsu-Hyohron Co.,Ltd. in Japan\uff09.<\/p>\n<p>\u96fb\u5b50\u5de5\u4f5c\u306e\u5b9f\u9a13\u5ba4\uff1a<a href=\"http:\/\/www.picfun.com\/ENC28J60frame.html\">ENC28J60\u3068TCP\/IP\u30b9\u30bf\u30c3\u30af\u306e\u4f7f\u3044\u65b9<\/a>.<\/p>\n<p>&lt;&lt;\u00a0Appendix &gt;&gt;<\/p>\n<p>ENC28J60 Ethernet LAN Network Module For Arduino SPI AVR PIC LPC STM32<\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/ENC28J60-Ethernet-Module.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2280\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/ENC28J60-Ethernet-Module.png\" alt=\"\" width=\"699\" height=\"557\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/ENC28J60-Ethernet-Module.png 699w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2017\/04\/ENC28J60-Ethernet-Module-300x239.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p>\u4eca\u56de\u306e\u8a66\u4f5c\u3067\u306f\u534a\u7530\u4ed8\u3051\u3092\u697d\u3057\u3080\u76ee\u7684\u3082\u3042\u308a\u3001ENC28J60 (SPDIP) \u3092\u4f7f\u7528\u3057\u305f\u3002\u624b\u9593\u3092\u7701\u304f\u306b\u306f\u3001ENC28J60\u00a0\u304b\u3089 RJ45 8P8C Modular Jack \u307e\u3067\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3057\u305f\u88fd\u54c1\u304c\u3001\u4e2d\u56fd\u767a\u9001\u306e\u901a\u8ca9\u30b5\u30a4\u30c8\u306a\u3089\u73fe\u6642\u70b9\u3067\u3082 500 \u5186\u4ee5\u4e0b\u3067\u5165\u624b\u3067\u304d\u308b\u306e\u3067\u3001\u899a\u609f\u3092\u6301\u3063\u3066\u767a\u6ce8\u3059\u308b\u306e\u3082\u4e00\u8208\u3067\u3042\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;&lt; Introduction in Japanese &gt;&gt; \u30ef\u30f3\u30c1\u30c3\u30d7\u30de\u30a4\u30b3\u30f3\u3092\u7528\u3044\u305f\u5b9f\u9a13\u7bc4\u56f2\u3092\u5e83\u3052\u308b\u305f\u3081\u306b\u3001\u4eca\u56de\u306f\u30a4\u30fc\u30b5\u30fc\u30cd\u30c3\u30c8\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u5b9f\u9a13\u30dc\u30fc\u30c9\u3092\u5236\u4f5c\u3057\u305f\u3002\u30a4\u30fc\u30b5\u30fc\u30cd\u30c3\u30c8 [&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-1822","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\/1822","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=1822"}],"version-history":[{"count":1,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1822\/revisions"}],"predecessor-version":[{"id":3376,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1822\/revisions\/3376"}],"wp:attachment":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/media?parent=1822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/categories?post=1822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/tags?post=1822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}