{"id":2877,"date":"2019-04-10T21:00:08","date_gmt":"2019-04-10T12:00:08","guid":{"rendered":"http:\/\/otsuka.biz\/blog1\/?p=2877"},"modified":"2024-02-12T17:36:27","modified_gmt":"2024-02-12T08:36:27","slug":"ethernet-and-usb-board-using-pic24fj256gb106-and-enc28j60","status":"publish","type":"post","link":"https:\/\/otsuka.biz\/blog1\/ethernet-and-usb-board-using-pic24fj256gb106-and-enc28j60\/","title":{"rendered":"Ethernet and USB board using PIC24FJ256GB106 and ENC28J60"},"content":{"rendered":"\n<p>&lt;&lt; Introduction in Japanese &gt;&gt;<br>\u4e45\u3005\u306e\u96fb\u5b50\u5de5\u4f5c\u3068\u3057\u3066\u306f\u4eca\u66f4\u3068\u8a00\u308f\u308c\u308b\u3060\u308d\u3046\u304c\u3001\u4eca\u56de\u59cb\u3081\u3066 TQFP (Thin Quad Flat Package) \u306e\u534a\u7530\u4ed8\u3051\u306b\u6311\u6226\u3057\u3066\u307f\u305f\u3002\u9078\u3093\u3060\u30c1\u30c3\u30d7\u306f 64 \u30d4\u30f3\u306e PIC24FJ256GB106 \u3067\u30012.54mm \u5909\u63db\u57fa\u677f\u306b\u534a\u7530\u4ed8\u3051\u3092\u3057\u305f\u3002\u30cd\u30c3\u30c8\u306b\u4e0a\u3052\u3089\u308c\u3066\u3044\u308b\u5e7e\u3064\u304b\u306e\u30a2\u30c9\u30d0\u30a4\u30b9\u306b\u5f93\u3048\u3070\u3001\u521d\u3081\u3066\u3067\u3082 TQFP \u306e\u534a\u7530\u4ed8\u3051\u306b\u6210\u529f\u3067\u304d\u305f\u4e8b\u304c\u5b09\u3057\u304b\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306e PIC24FJ256GB106 \u3092\u4f7f\u3063\u305f\u5b9f\u9a13\u30dc\u30fc\u30c9\u4e0a\u306b\u306f\u3001\u30a4\u30fc\u30b5\u30fc\u30cd\u30c3\u30c8\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc ENC28J60 \u3092\u4f75\u8a2d\u3057\u3001\u5916\u90e8\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u3057\u3066 RJ-45 \u30b3\u30cd\u30af\u30bf\u3068 USB receptacle (Type A) \u30b3\u30cd\u30af\u30bf\u3092\u5b9f\u88c5\u3055\u305b\u305f\u3002<\/p>\n\n\n\n<p>PIC24FJ256GB106 \u306b\u306f\u3001 HTTP \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u8fbc\u3093\u3067\u3001\u3053\u308c\u3092\u30d1\u30bd\u30b3\u30f3\u306e\u30a6\u30a7\u30d6\u30fb\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3067\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u4e00\u3064\u4e88\u60f3\u5916\u3060\u3063\u305f\u306e\u306f\u3001PIC24FJ256GB106 \u304c EEPROM \u3092\u5185\u8535\u3057\u3066\u3044\u306a\u3044\u4e8b\u3067\u3001HTML \u30b3\u30fc\u30c9\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u30fb\u30e1\u30e2\u30ea\u306b\u53ce\u3081\u308b\u70ba\u306b\u3001\u305d\u306e\u30b5\u30a4\u30ba\u306b\u306f\u6ce8\u610f\u3092\u6255\u3046\u5fc5\u8981\u304c\u751f\u3058\u305f\u3002\u5b9f\u9a13\u3067\u306f\u77ed\u3044\u6587\u5b57\u5217\u3060\u3051\u306e\u30da\u30fc\u30b8\u3068\u3057\u3066\u3001\u305d\u308c\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3060\u3051\u306b\u7559\u3081\u305f\u3002\u5927\u304d\u306a HTML \u30b3\u30fc\u30c9\u3092\u53ce\u3081\u308b\u70ba\u306b\u306f\u3001\u5916\u90e8 EEPROM \u304c\u5fc5\u8981\u3068\u306a\u308b\u3002<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-1024x768.jpg\" alt=\"\" class=\"wp-image-2895\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-1024x768.jpg 1024w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-300x225.jpg 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>PIC24FJ256GB106   &lt;\u2014 SPI \u2014&gt;   ENC28J60   &lt;\u2014 Ethernet \u2014&gt;   Local area network<\/p>\n\n\n\n<p>(TCP\/IP protocols are included in the application code for the PIC24FJ256GB106.)<\/p>\n\n\n\n<p>&lt;&lt; Architecture of the Ethernet board &gt;&gt;<br>The Ethernet controller, ENC28J60, is connected with the microcontroller, PIC24FJ256GB106, using the Serial Peripheral Interface (SPI).<\/p>\n\n\n\n<p>Clock and pin connection of PIC24FJ256GB106 : The system clock of 48MHz is derived from the internal oscillator of 8MHz using the PLL module.<\/p>\n\n\n\n<p>LED : pin 2 (RE6), pin 3 (RE7).<br>Switch (pull down) : pin 7 (MCLR), pin 8 (RG9).<\/p>\n\n\n\n<p>LCD (SC1602BBWB-XA-GB-G) : VDD \u2013 5 volt, RS \u2013 pin 64 (RE4), R\/W \u2013 GND, E \u2013 pin 1 (RE5),<br>Data bus (4-bit mode) : DB4 \u2013 pin 60 (RE0), DB5 \u2013 pin 61 (RE1), DB6 \u2013 pin 62 (RE2), DB7 \u2013 pin 63 (RE3). <\/p>\n\n\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2913 size-full\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106.png\" alt=\"\" width=\"1082\" height=\"1680\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106.png 1082w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-193x300.png 193w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-768x1192.png 768w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2019\/04\/PIC24FJ256GB106-660x1024.png 660w\" sizes=\"auto, (max-width: 1082px) 100vw, 1082px\" \/><\/a><\/p>\n\n\n<p>(Reproduced from the figure in <a href=\"http:\/\/www.picfun.com\/ENC28J60frame.html\">the site of reference<\/a>)<\/p>\n\n\n\n<p>ENC28J60 :<br>Pin 4 INT&nbsp; \u2013- &nbsp;Open (Out of use),<br>Pin 6 SO&nbsp; \u2013- &nbsp;PIC pin 31 (RP10\/RF4 assigned to SDI1),<br>Pin 7 SI&nbsp; \u2013- &nbsp;PIC pin 32 (RP17\/RF5 assigned to SDO1),<br>Pin 8 SCK&nbsp; \u2013- &nbsp;PIC pin 33 (RP16\/RE3 assigned to SCK1),<br>Pin 9 CS&nbsp; \u2013- &nbsp;PIC pin 58 (RF0),<br>Pin 10 RESET&nbsp; \u2013- &nbsp;Open (Internally pulled-up to VDD).<\/p>\n\n\n\n<p>&lt;&lt; Sample code for the Ethernet board &gt;&gt;<\/p>\n\n\n\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_pic24fj256gb106_enc28j60\/'>Ethernet_PIC24FJ256GB106_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> 1.91 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_pic24fj256gb106_enc28j60\/?wpdmdl=3402&refresh=69ff2bb236bdc1778330546\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div>\n\n\n\n<p>(Compiled by the XC16 on the MPLAB X IDE)<\/p>\n\n\n\n<p>In TCPIP ENC28.h, STACK_USE_ICMP_SERVER, STACK_USE_DHCP_CLIENT and STACK_USE_NBNS have been defined in this project.  Consequently, the test board can practice the communications-protocol of ICMP, ARP, DHCP Client and NBNS.<\/p>\n\n\n\n<p>The default network configuration in TCPIP ENC28.h must be adjusted to your local network (MAC address, IP address and so on).<\/p>\n\n\n\n<p>Example above :<br>NetBIOS Name = PIC24FJ256GB106<br>Default MAC address = {0x00, 0x04, 0xA3, 0x00, 0x00, 0x00}<br>Default IP address  = 192.168.1.10<br>Default subnet mast = 255.255.255.0<br>Default gateway = 192.168.1.1<br>Default primary DNS = 192.168.1.1<br>Default secondary DNS = 0.0.0.0<\/p>\n\n\n\n<p>The connection to the Ethernet board can be checked by the ping on the Command Prompt of your Windows PC. And if the connection has been established, the test page can be viewed by a web-browser on your computer.<\/p>\n\n\n\n<p>&lt;&lt; Reference &gt;&gt;<br>TCP\/IP stack : Microchip Libraries for Applications v2013-06-15. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;&lt; Introduction in Japanese &gt;&gt;\u4e45\u3005\u306e\u96fb\u5b50\u5de5\u4f5c\u3068\u3057\u3066\u306f\u4eca\u66f4\u3068\u8a00\u308f\u308c\u308b\u3060\u308d\u3046\u304c\u3001\u4eca\u56de\u59cb\u3081\u3066 TQFP (Thin Quad Flat Package) \u306e\u534a\u7530\u4ed8\u3051\u306b\u6311\u6226\u3057 [&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-2877","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\/2877","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=2877"}],"version-history":[{"count":1,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/2877\/revisions"}],"predecessor-version":[{"id":3403,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/2877\/revisions\/3403"}],"wp:attachment":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/media?parent=2877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/categories?post=2877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/tags?post=2877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}