×

CN0343超声波测距用户指南

消耗积分:2 | 格式:pdf | 大小:6.24MB | 2021-04-09

分享资料个

This version (03 Jan 2021 21:58) was approved by Robin Getz.The Previously approved version (15 Dec 2017 22:40) is available.Diff

CN0343 Ultrasonic Distance Measurement User Guide

Overview

The CN0343 is a completely self-contained distance sensor that utilizes an ultrasonic transmitter and sensitive analog receiver in conjunction with a precision analog microcontroller to provide distance measurements. The CN0343 approximate range is from 50cm to 10m with a resolution of about 2cm. Temperature compensation is provided by the integrated temperature sensor and analog-to-digital converter (ADC) contained in the microcontroller.

Hardware Connections

The CN0343 have three connectors:

  • J1 is power connector
  • J2 is RS-485 communication interface connector
  • J3 is the MCU JTAG debug interface connector

The connectors position marked in the following CN0343 picture in yellow font.

Power supply Connections

The CN0343 J1 connector use for power supply with the EVAL-CFTL-6V-PWRZ , before power on the CN0343 please make sure all the necessary connector connected well and firm.

RS-485 interface connections

The J2 connector in CN0343 is use for the RS-485 communication interface, the pin number of J2 is marked in the following picture in yellow font, the pin map of J2 is marked in blue font.

The CN0343 RS-485 interface working at the half-duplex mode, there only need one twisted pair cable to build the RS-485 network.

Please notice: the RS-485 interface has limitation on the total devices number in the same network and cable type and length, for the detail of CN0343 RS-485 interface characteristics please check ADM3483

JTAG/SWD connections

The J3 connector of CN0343 is use for the ADuC7126 MCU JTAG debug and programming download. The pin number of J3 is marked in the following picture in blue font.

The CN0343 J3 JTAG 20pins 0.1 inch pitch connector pin map is compatible with the SEGGER J-LINK debug probe , for more detail please check the SEGGER web site .

Usage Instructions

The CN0343 can be running in standalone mode or connect multiple CN0343 into one RS-485 network to make group measurement.

The CN0343 user interface contained one LCD screen and one buzzer as information output, six tactile button as the user input.

LCD Screen and Buttons User Interface

The CN0343 LCD have a contrast adjust potentiometer R1 marked in the following picture as purple font.

The CN0343 have six tactile button, the function of each button marked as red font in the following picture.

In this chapter the press button or button pressed event expression means single click the tactile button.

If the CN0343 power up with the beep and LCD screen display murky or dull, please adjust R1 with screwdriver gently to make LCD clear

The CN0343 have following of running status:

  • SPLASH: when power up the CN0343 will enter the SPLASH status, the screen will showing
 ANALOG DEVICES
EVAL-CN0343-EB1Z 
At the SPLASH status the CN0343 will not response any of button press or RS-485 input, please wait for 3 seconds, the CN0343 will enter the MEASURING status.
  • MEASURING: At MEASURING status the CN0343 will showing:
Distance: 1.253m
 Temp: 25.2°C 

The distance and temperature value may different based on the CN0343 working situation.

  • MENU: if the OK button pressed in MEASURING: status the CN0343 will enter the MENU status, at the MENU status the CN0343 will showing one of following screen:
Calibrate
    Temperature? 
Set address?
Set baud rate?
Set address?
  • SETTINGS: if the OK pressed in MENU status, the corresponding setting status will be entered, at any of SETTING status, the screen will showing a blink cursor, for detail of CN0343 operation please reference the following table:
SPLASH MEASURING MENU SETTINGS
UP none none previous item increase number at cursor
DOWN none none next item decrease number at cursor
LEFT none none previous item move cursor left
RIGHT none none next item move cursor right
OK none enter MENU enter selected SETTING save and return to MENU
CANCEL none none return to MEASURING don't save and return to MENU

RS-485 Interface

The CN0343 software supported RS-485 address range is 1~255 (this is not equal to the ADM3483 hardware imitated devices number).

The CN0343 software supported RS-485 baud rate range is: 75bps~250kbps.

If you use multiple CN0343 in a same RS-485 network, please make sure all the CN0343 and host have same RS-485 baud rate and no address conflict. Because the CN0343 working in the half-duplex RS-485 mode, please make sure there only have one RS-485 device transmit data at a time.

The CN0343 will response following command:

xxx query/r/n

the xxx is the CN0343's decimal address, and /r/n is the return characters.

For example:

109 query
 

will trigger the CN0343 which have RS-485 address 109 send the measure result data to RS-485 network.

Please don't ignore the space character between address 109 and query command

Software Programming

The CN0343 software developed under the Keil Embedded Development Tools and debug with SEGGER J-Link Debug Probes, for the detail usage of Keil or J-Link please check above links.

Software development environment

After download and install the Keil Embedded Development Tools for ARM, open the Keil software IDE.

To open the CN0343 source code in Keil IDE please use following steps:

  1. Click open button
  2. Enter the CN0343 source code folder path
  3. Select the file type filter to Project files *.uvproj
  4. Double click the V5.0.uvproj

For the detail of Keil usage please reference to ARM Product Manuals.

How to download binary firmware to the CN0343

After the CN0343 software development, to download the binary firmware to internal flash of ADuC7126 please use following steps:

  1. Click build all button, wait for build finish
  2. Click load button, wait for download finish

Software Structure

The following is the snapshot of the CN0343 software package files:

V5.0
├── debug
│   ├── adcdriver.crf
│   ├── addressdialog.crf
│   ├── aduc7126bits.crf
│   ├── baudratedialog.crf
│   ├── buzzerdriver.crf
│   ├── calibratetemperaturedialog.crf
│   ├── debug.build_log.htm
│   ├── debug.sct
│   ├── exceptions.crf
│   ├── homedialog.crf
│   ├── initial.crf
│   ├── interrupt.crf
│   ├── keydriver.crf
│   ├── lcddriver.crf
│   ├── main.crf
│   ├── message.crf
│   ├── options.crf
│   ├── pwmdriver.crf
│   ├── retarget.crf
│   ├── rtostimer.crf
│   ├── setdialog.crf
│   ├── uartcommand.crf
│   ├── uart.crf
│   ├── uartdriver.crf
│   ├── V4.build_log.htm
│   └── wnd.crf
├── JLinkArm_debug.ini
├── JLinkArm_release.ini
├── Packs_debug.htm
├── release
│   ├── adcdriver.crf
│   ├── addressdialog.crf
│   ├── aduc7126bits.crf
│   ├── baudratedialog.crf
│   ├── buzzerdriver.crf
│   ├── calibratetemperaturedialog.crf
│   ├── exceptions.crf
│   ├── ExtDll.iex
│   ├── homedialog.crf
│   ├── initial.crf
│   ├── interrupt.crf
│   ├── keydriver.crf
│   ├── lcddriver.crf
│   ├── main.crf
│   ├── message.crf
│   ├── options.crf
│   ├── pwmdriver.crf
│   ├── RamFunctions.sct
│   ├── release.axf
│   ├── release.build_log.htm
│   ├── release.sct
│   ├── retarget.crf
│   ├── rtostimer.crf
│   ├── setdialog.crf
│   ├── uartcommand.crf
│   ├── uart.crf
│   ├── uartdriver.crf
│   └── wnd.crf
├── source
│   ├── applications
│   │   ├── dialog
│   │   │   ├── AddressDialog.cpp
│   │   │   ├── BaudRateDialog.cpp
│   │   │   ├── CalibrateTemperatureDialog.cpp
│   │   │   ├── HomeDialog.cpp
│   │   │   ├── SetDialog.cpp
│   │   │   └── Wnd.cpp
│   │   ├── main.cpp
│   │   ├── Message.cpp
│   │   ├── Options.cpp
│   │   └── UARTCommand.cpp
│   ├── bios
│   │   ├── ADuC7126Bits.cpp
│   │   ├── ADuC712x.s
│   │   ├── Exceptions.cpp
│   │   ├── Initial.cpp
│   │   ├── Interrupt.cpp
│   │   ├── Retarget.c
│   │   ├── Retarget.cpp
│   │   └── UART.cpp
│   ├── drivers
│   │   ├── ADCDriver.cpp
│   │   ├── BuzzerDriver.cpp
│   │   ├── KeyDriver.cpp
│   │   ├── LCDDriver.cpp
│   │   ├── PWMDriver.cpp
│   │   ├── RTOSTimer.cpp
│   │   └── UARTDriver.cpp
│   ├── include
│   │   ├── applications
│   │   │   ├── Dialog
│   │   │   │   ├── AddressDialog.h
│   │   │   │   ├── BaudRateDialog.h
│   │   │   │   ├── CalibrateTemperatureDialog.h
│   │   │   │   ├── HomeDialog.h
│   │   │   │   ├── SetDialog.h
│   │   │   │   └── Wnd.h
│   │   │   ├── Message.h
│   │   │   ├── Options.h
│   │   │   └── UARTCommand.h
│   │   ├── bios
│   │   │   ├── ADuC7126Bits.H
│   │   │   ├── atomic.h
│   │   │   ├── Initial.h
│   │   │   ├── Interrupt.h
│   │   │   ├── Retarget.h
│   │   │   └── UART.h
│   │   ├── Drivers
│   │   │   ├── ADCDriver.h
│   │   │   ├── BuzzerDriver.h
│   │   │   ├── KeyDriver.h
│   │   │   ├── LCDDriver.h
│   │   │   ├── PWMDriver.h
│   │   │   ├── RTOSTimer.h
│   │   │   └── UARTDriver.h
│   │   └── library
│   │       └── SafeQueue.h
│   └── library
│       └── SafeQueue.cpp
├── V5.0.build_log.htm
├── V5.0.uvgui.r
├── V5.0.uvgui_r.bak
├── V5.0.uvgui.rl
├── V5.0.uvgui_rl.bak
├── V5.0.uvgui.RLee4
├── V5.0.uvgui_RLee4.bak
├── V5.0.uvopt
├── V5.0_uvopt.bak
├── V5.0.uvproj
└── V5.0_uvproj.bak

Schematic, Bill of Materials, Gerber Files, Source Code

EVAL-CN0343-EB1Z Design & Integration Files

  • Schematics
  • Gerber Files
  • PADS Layout Files
  • Bill of Materials
  • Source Code

End of Document

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.obk20.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'CN0343超声波测距用户指南',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.obk20.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);