{"id":1082,"date":"2016-02-07T12:36:17","date_gmt":"2016-02-07T03:36:17","guid":{"rendered":"http:\/\/otsuka.biz\/blog1\/?p=1082"},"modified":"2024-02-12T15:59:03","modified_gmt":"2024-02-12T06:59:03","slug":"hands-free-set-for-smartphones-with-rn-52-pic24fj64gb002","status":"publish","type":"post","link":"https:\/\/otsuka.biz\/blog1\/hands-free-set-for-smartphones-with-rn-52-pic24fj64gb002\/","title":{"rendered":"Hands-free phone system with RN52 Bluetooth module and PIC24FJ64GB002"},"content":{"rendered":"<p>I began to assemble a hand-free phone system by the RN52 Bluetooth module of\u00a0Microchip Technology Inc. \u00a0\u00a0 The RN52 is very reasonable but is small for hobby.\u00a0\u00a0\u00a0 This blog reports only a CMD mode function because my present board doesn\u2019t have an audio component yet.\u00a0\u00a0 A complete report will be uploaded when this set is equipped with an audio component.<\/p>\n<p>&lt;&lt; Introduction in Japanese &gt;&gt;<\/p>\n<p>\u6628\u5e74\u79cb\u306b\u643a\u5e2f\u96fb\u8a71\u3092 FOMA \u304b\u3089 iPhone \u306b\u5909\u66f4\u3057\u305f\u3002FOMA \u30b5\u30fc\u30d3\u30b9\u7d42\u4e86\u307e\u3067\u5229\u7528\u3057\u3088\u3046\u3068\u601d\u3063\u3066\u3044\u305f\u304c\u3001\u5916\u51fa\u4e2d\u3067\u306e\u30d6\u30e9\u30a6\u30b6\u95b2\u89a7\u306e\u5fc5\u8981\u306b\u8feb\u3089\u308c\u3001\u30b5\u30fc\u30d3\u30b9\u5909\u66f4\u3092\u884c\u3063\u305f\u3002\u306a\u3089\u3070\u5de5\u4f5c\u30cd\u30bf\u306e\u5bfe\u8c61\u3068\u3057\u3066\u8003\u3048\u308b\u306e\u3082\u5fc5\u7136\u3067\u3001\u4ee5\u524d\u304b\u3089\u306e\u30c6\u30fc\u30de\u3067\u3082\u3042\u308b\u30cf\u30f3\u30ba\u30d5\u30ea\u30fc\u901a\u8a71\u306e\u5de5\u4f5c\u306b\u53d6\u308a\u639b\u304b\u3063\u305f\u3002\u6a5f\u7a2e\u306f iPhone 6s \u3067\u3042\u308b\u306e\u3067\u3001FOMA \u306e\u3088\u3046\u306b USB \u63a5\u7d9a\u3067\u306e\u30cf\u30f3\u30ba\u30d5\u30ea\u30fc\u64cd\u4f5c\u3067\u306a\u304f\u3001Bluetooth \u63a5\u7d9a\u3067\u306e\u64cd\u4f5c\u3068\u306a\u308b\u3002<br \/>\nHFP \u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305f Bluetooth module \u3068\u3057\u3066 Microchip technology \u793e\u306e RN52 \u3092\u7528\u3044\u305f\u3002RN52 \u3092 2.54 mm \u57fa\u677f\u306b\u534a\u7530\u4ed8\u3051\u3059\u308b\u306e\u306b\u306f\u82e6\u52b4\u3057\u305f\u3002\u4eca\u5f8c\u306f\u8001\u773c\u3082\u9032\u307f\u4e8c\u5ea6\u3068\u51fa\u6765\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u3001SparkFun Audio Bluetooth Breakout &#8211; RN-52 \u306e\u5229\u7528\u3092\u8003\u3048\u308b\u3002<br \/>\n\u4eca\u56de\u306f\u9014\u4e2d\u7d4c\u904e\u3068\u3057\u3066 command mode \u3067\u306e\u767a\u7740\u4fe1\u306e\u52d5\u4f5c\u78ba\u8a8d\u307e\u3067\u3092\u5831\u544a\u3059\u308b\u3002\u97f3\u58f0\u6a5f\u80fd\u306b\u95a2\u3057\u3066\u306f\u5b8c\u5099\u51fa\u6765\u305f\u3089\u6539\u3081\u3066\u5831\u544a\u3059\u308b\u3002<\/p>\n<p>Mobile phone \u00a0&lt;&#8211;\u00a0\u00a0Bluetooth\u00a0 &#8211;&gt;\u00a0 RN52\u00a0 &lt;&#8211;\u00a0 UART\u00a0 &#8211;&gt;\u00a0 PIC24FJ64GB002\u00a0 &lt;&#8211;\u00a0 USB\u00a0 &#8211;&gt;\u00a0 Keypad<\/p>\n<p><a href=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/02\/HF-Bluetooth-1.jpg\" rel=\"attachment wp-att-1132\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1132\" src=\"http:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/02\/HF-Bluetooth-1.jpg\" alt=\"HF Bluetooth-1\" width=\"1717\" height=\"1325\" srcset=\"https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/02\/HF-Bluetooth-1.jpg 1717w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/02\/HF-Bluetooth-1-300x232.jpg 300w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/02\/HF-Bluetooth-1-768x593.jpg 768w, https:\/\/otsuka.biz\/blog1\/wp-content\/uploads\/2016\/02\/HF-Bluetooth-1-1024x790.jpg 1024w\" sizes=\"auto, (max-width: 1717px) 100vw, 1717px\" \/><\/a><\/p>\n<p>Inputted numbers are displayed in the first line of the LCD and the current connection status of the RN52 obtained with the Q command is in the second line.<\/p>\n<p>&lt;&lt; PIC microcontroller board &gt;&gt;<\/p>\n<p>Test board is the same\u00a0in my blog page on Aug. 31, 2014.<br \/>\n( In Japanese : \u5e73\u621026\u5e748\u670831\u65e5\u306e\u7a3f\u3067\u793a\u3057\u305f\u30dc\u30fc\u30c9\u3092\u4f7f\u7528 )<\/p>\n<p>Clock and pin connection of my board with PIC24FJ64GB002 :<\/p>\n<p>FRC 8 MHz &#8211; 96 MHz PLL;<br \/>\n48 MHz for USB Module (96 MHz PLL divide by 2);<br \/>\n32 MHz for System Clock\u00a0(96 MHz PLL divide by 3);<\/p>\n<p>LED : RB0, RB1; \u00a0\u00a0 Switch (pull down) :\u00a0MCLR, RB2;<\/p>\n<p>LCD\u00a0(SC1602BBWB-XA-GB-G) :\u00a0RS &#8211; RB7, R\/W &#8211; GND, E &#8211; RB8, Data bus : DB4 &#8211; RB9, DB5 &#8211; RB13, DB6 &#8211; RB14, DB7 &#8211;\u00a0RB15;<\/p>\n<p>&lt;&lt; RN52 &gt;&gt;<\/p>\n<p>pin 3\u00a0\u00a0 GIO2\u00a0&#8211; \u00a0PIC pin 12 (RP4\/RB4)<br \/>\npin 11 GIO9\u00a0&#8211;\u00a0 PIC pin 11 (RA4)<br \/>\npin 16 TX\u00a0\u00a0\u00a0\u00a0 &#8211;\u00a0 PIC pin 2 (RP5\/RA0) assigned to U2RX<br \/>\npin 17 RX\u00a0\u00a0\u00a0\u00a0 &#8211;\u00a0 PIC pin 3 (RP6\/RA1) assigned to U2TX<br \/>\npin 21 PWREN &#8211; switch (pull high)<br \/>\nFor flow control is not used, RN52 pin 14 RTS is connected with RN52 pin 15 CTS.<\/p>\n<p>Default UART configuration of\u00a0the RN52 module :<br \/>\nBaud rate : 115,200 Kbps<br \/>\nBits : 8<br \/>\nParity : None<br \/>\nStop bits : 1<\/p>\n<p>&lt;&lt;\u00a0Sample code\u00a0&gt;&gt;<\/p>\n<p>Revision on February 23, 2016<\/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\/hands-free-bluetooth\/'>Hands-free-bluetooth<\/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> 45.46 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\/hands-free-bluetooth\/?wpdmdl=3357&refresh=69de20c9068701776165065\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div> (A project of MPLAB X IDE containing HEX.file only)<\/p>\n<p>Based\u00a0on Microchip Libraries for Applications v2014_07_22<\/p>\n<p>&lt;&lt; Function of this set &gt;&gt;<\/p>\n<p>You can power up the RN52 module by driving PWREN high.<\/p>\n<p>If you enter a telephone number, RN52 will initiate outgoing call automatically after 3 seconds.<\/p>\n<p>The maximum telephone number is 11 digits.<\/p>\n<p>Enter-key is used to accept incoming call, to initiate outgoing call, and to terminate call.<\/p>\n<p>Back-space key is used to cancel a last inputted\u00a0number.<\/p>\n<p>PIC-RB2-switch is used to practice a factory reset of RN52.<\/p>\n<p>In Japanese :<\/p>\n<p>&lt;&lt; \u64cd\u4f5c\u65b9\u6cd5 &gt;&gt;<\/p>\n<p>RN52 \u306e PWREN &#8211; switch\u00a0\u3092\u9577\u62bc\u3057\u3057\u3066\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8d77\u52d5\u3002<\/p>\n<p>\u96fb\u8a71\u756a\u53f7\u306f\u6700\u5927\uff11\uff11\u6841\u3001\u7d04\uff13\u79d2\u3067\u81ea\u52d5\u767a\u4fe1\u3002<\/p>\n<p>Enter key\uff1a\u7740\u4fe1\u5fdc\u7b54\u3001\u5f37\u5236\u767a\u4fe1\u3001\u5207\u65ad\u3002<\/p>\n<p>Back space\uff1a\uff11\u6587\u5b57\u30ad\u30e3\u30f3\u30bb\u30eb\u3002<\/p>\n<p>PIC \u306e RB2-switch \u3067 RN52 \u3092\u5de5\u5834\u51fa\u8377\u6642\u8a2d\u5b9a\u306b\u30ea\u30bb\u30c3\u30c8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I began to assemble a hand-free phone system by the RN52 Bluetooth module of\u00a0Microchip Technology Inc. \u00a0\u00a0 The  [&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,10],"tags":[],"class_list":["post-1082","post","type-post","status-publish","format-standard","hentry","category-pic","category-telephone"],"_links":{"self":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1082","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=1082"}],"version-history":[{"count":2,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1082\/revisions"}],"predecessor-version":[{"id":3358,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/posts\/1082\/revisions\/3358"}],"wp:attachment":[{"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/media?parent=1082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/categories?post=1082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otsuka.biz\/blog1\/wp-json\/wp\/v2\/tags?post=1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}