{"id":1412,"date":"2016-08-05T14:17:37","date_gmt":"2016-08-05T05:17:37","guid":{"rendered":"http:\/\/otsuka.biz\/blog1\/?p=1412"},"modified":"2024-02-12T16:20:26","modified_gmt":"2024-02-12T07:20:26","slug":"lc-meter-with-pic18f2550","status":"publish","type":"post","link":"https:\/\/otsuka.biz\/blog1\/lc-meter-with-pic18f2550\/","title":{"rendered":"LC meter using PIC18F2550"},"content":{"rendered":"<p>I assembled a LC meter using the PIC18F2550 by referring to previous reports.\u00a0\u00a0 Capacitance or inductance is derived from parameters of the Franklin oscillator, which is built of a comparator of the PIC18F2550.\u00a0\u00a0 Measurement is not accurate but is enough to use for my hobbies.<\/p>\n<p>&lt;&lt; Introduction in Japanese &gt;&gt;<\/p>\n<p>PIC \u30de\u30a4\u30b3\u30f3\u3092\u7528\u3044\u305f\u30b3\u30f3\u30c7\u30f3\u30b5\u306e\u5bb9\u91cf\u3001\u30b3\u30a4\u30eb\u306e\u30a4\u30f3\u30c0\u30af\u30bf\u30f3\u30b9\u3092\u6e2c\u5b9a\u3059\u308b LC \u30e1\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u305f\u3002\u30cd\u30c3\u30c8\u3067\u691c\u7d22\u3059\u308b\u3068 PIC \u30de\u30a4\u30b3\u30f3\u3092\u5229\u7528\u3057\u305f LC \u30e1\u30fc\u30bf\u306e\u5236\u4f5c\u8a18\u4e8b\u306f\u5bb9\u6613\u306b\u898b\u3064\u3051\u308b\u4e8b\u304c\u51fa\u6765\u308b\u3002\u6e2c\u5b9a\u7cbe\u5ea6\u306f\u30db\u30d3\u30fc\u30fb\u30e6\u30fc\u30b9\u306b\u65bc\u3051\u308b\u6982\u7b97\u7a0b\u5ea6\u3068\u601d\u3063\u3066\u826f\u3044\u3002\u767a\u632f\u56de\u8def\u306e\u5468\u6ce2\u6570\u3092\u6e2c\u5b9a\u3059\u308b\u969b\u306e\u30b2\u30fc\u30c8\u6642\u9593\u3092 0.1 \u79d2\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u304c\u3001\u691c\u4f53\u306e\u30ad\u30e3\u30d1\u30b7\u30bf\u30f3\u30b9\u3084\u30a4\u30f3\u30c0\u30af\u30bf\u30f3\u30b9\u304c\u5927\u304d\u304f\u306a\u308b\u3068\u3001\u767a\u632f\u5468\u6ce2\u6570\u304c\u5c0f\u3055\u304f\u306a\u308a\u3001\u77ed\u3044\u30b2\u30fc\u30c8\u6642\u9593\u3067\u6e2c\u5b9a\u3059\u308b\u5468\u6ce2\u6570\u306b\u3082\u8aa4\u5dee\u304c\u5927\u304d\u304f\u306a\u308b\u3002\u307e\u305f PIC \u30de\u30a4\u30b3\u30f3\u306b\u3088\u308b\u6f14\u7b97\u7cbe\u5ea6\u306b\u3082\u5236\u9650\u304c\u3042\u308b\u305f\u3081\u3001\u7b97\u51fa\u7cbe\u5ea6\u306b\u904e\u5927\u306a\u671f\u5f85\u306f\u51fa\u6765\u306a\u3044\u3002<\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1419\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter.jpg\" alt=\"LC meter\" width=\"2301\" height=\"2109\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter.jpg 2301w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter-300x275.jpg 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter-768x704.jpg 768w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter-1024x939.jpg 1024w\" sizes=\"auto, (max-width: 2301px) 100vw, 2301px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1420\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter.png\" alt=\"LC meter\" width=\"846\" height=\"372\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter.png 846w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter-300x132.png 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/08\/LC-meter-768x338.png 768w\" sizes=\"auto, (max-width: 846px) 100vw, 846px\" \/><\/a><\/p>\n<p>&lt;&lt; Measurement &gt;&gt;<\/p>\n<p>Measurement of capacitance or inductance can be selected by the slide-switch.<br \/>\nSet an object to terminals.<br \/>\nAfter powered up, the system is going to start measurement.<\/p>\n<p>&lt;&lt; Calibration &gt;&gt;<\/p>\n<ol>\n<li>Remove an object from terminals and set SW3 (slide-switch) for \u201ccapacitance\u201d.<\/li>\n<li>While pressing the SW2, reset the system by the SW1.\u00a0\u00a0 Then the procedure of calibration starts.<\/li>\n<li>When a frequency proper to the board is stable, release the SW2.<\/li>\n<li>After setting a reliable capacitor of 1000 pF to terminals, hold the SW2 on.<\/li>\n<li>When a frequency is stable, release the SW2.<\/li>\n<li>After removing the object and set SW3 (slide-switch) for \u201cinductance\u201d, hold the SW2 on.<\/li>\n<li>When a frequency is stable, release the SW2.<\/li>\n<li>After calibration is completed, the system dose the routine of measurement.<\/li>\n<\/ol>\n<p>&lt;&lt;\u00a0\u4f7f\u7528\u6cd5 &gt;&gt;<\/p>\n<p>\u6e2c\u5b9a\u306f\u96fb\u6e90\u3092\u5165\u308c\u3066\u691c\u4f53\u3092\u7aef\u5b50\u306b\u63a5\u7d9a\u3059\u308b\u3060\u3051\u3067\u3042\u308b\u3002<\/p>\n<p>&lt;&lt; \u5b9a\u6570\u306e\u6821\u6b63\u3068 EEPROM \u3078\u306e\u4fdd\u5b58\uff08\u30ad\u30e3\u30ea\u30d6\u30ec\u30fc\u30b7\u30e7\u30f3\uff09&gt;&gt;<\/p>\n<p>\uff11\u3000\u691c\u4f53\u3092\u53d6\u308a\u5916\u3059\u3002\u30b9\u30e9\u30a4\u30c9\u30fb\u30b9\u30a4\u30c3\u30c1 (SW3) \u3067\u300c\u30b3\u30f3\u30c7\u30f3\u30b5\u300d\u3092\u9078\u629e\u3002<br \/>\n\uff12\u3000SW2 \u3092\u62bc\u3057\u306a\u304c\u3089 SW1 \u3067\u30ea\u30bb\u30c3\u30c8\u3002<br \/>\n\uff13\u3000SW2 \u62bc\u3057\u305f\u72b6\u614b\u3092\u7dad\u6301\u3002\u767a\u632f\u5468\u6ce2\u6570 Fcap \u304c\u5b89\u5b9a\u3057\u305f\u3089 SW2 \u3092\u89e3\u653e\u3002<br \/>\n\uff14\u3000\u6821\u6b63\u7528\u30b3\u30f3\u30c7\u30f3\u30b5 1000pF \u3092\u7aef\u5b50\u306b\u88c5\u7740\u3002<br \/>\n\uff15\u3000SW2 \u3092\u62bc\u3057\u305f\u72b6\u614b\u3092\u7dad\u6301\u3002\u767a\u632f\u6570\u6ce2\u6570 Fobj \u304c\u5b89\u5b9a\u3057\u305f\u3089 SW2 \u3092\u89e3\u653e\u3002<br \/>\n\uff16\u3000\u30b9\u30e9\u30a4\u30c9\u30fb\u30b9\u30a4\u30c3\u30c1 (SW3) \u3067\u300c\u30b3\u30a4\u30eb\u300d\u3092\u9078\u629e\u3002\u7aef\u5b50\u9593\u3092\u30ea\u30fc\u30c9\u7dda\u3067\u77ed\u7d61\u3059\u308b\u3002<br \/>\n\uff17\u3000SW2 \u3092\u62bc\u3057\u305f\u72b6\u614b\u3092\u7dad\u6301\u3002\u767a\u632f\u5468\u6ce2\u6570 Find \u304c\u5b89\u5b9a\u3057\u305f\u3089 SW2 \u3092\u653e\u3059\u3002<br \/>\n\uff18\u3000\u691c\u4f53\u6e2c\u5b9a\u306e main loop \u306b\u623b\u308b\u3002<\/p>\n<p>&lt;&lt; Sample code &gt;&gt;<\/p>\n<p><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\/lc-meter\/'>LC meter<\/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> 20.11 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\/lc-meter\/?wpdmdl=3369&refresh=69d5c4a61a2821775617190\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div> (compiled with MPLAB X IDE and XC8)<\/p>\n<p>The PIC18F Peripheral Libraries needs to be installed into the XC8 compiler to use EEPROM.<\/p>\n<p>&lt;&lt;\u00a0Reference &gt;&gt;<\/p>\n<p><a href=\"http:\/\/projectproto.blogspot.jp\/2010\/10\/pic18f-usb-lc-meter.html\">PIC18F USB LC Meter<\/a><\/p>\n<p><a href=\"http:\/\/www.zea.jp\/audio\/lcm\/lcm_01.htm\">LC\u30e1\u30fc\u30bf\u30fc\uff08\u96fb\u5b50\u30de\u30b9\u30ab\u30c3\u30c8\uff09<\/a><\/p>\n<p><a href=\"http:\/\/www.picfun.com\/f1make\/f1make04.html\">LC\u30e1\u30fc\u30bf\uff08\u96fb\u5b50\u5de5\u4f5c\u306e\u5b9f\u9a13\u5ba4\uff09<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I assembled a LC meter using the PIC18F2550 by referring to previous reports.\u00a0\u00a0 Capacitance or inductance is d [&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,5],"tags":[],"class_list":["post-1412","post","type-post","status-publish","format-standard","hentry","category-pic","category-radio-frequency"],"_links":{"self":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1412","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=1412"}],"version-history":[{"count":2,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1412\/revisions"}],"predecessor-version":[{"id":3370,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1412\/revisions\/3370"}],"wp:attachment":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/media?parent=1412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/categories?post=1412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/tags?post=1412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}