日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > 嵌入式 > 嵌入式軟件
[導讀]找出微處理器ADC電壓的十六進制編碼值

這種設計方案針對低檔八管腳flash存儲的8位微處理器,例如Freescale的MC68HC908QT4A,但是它也同樣適用于任何一款擁有ADC模塊的8位微處理器。在芯片內,ADC轉換輸入的模擬電壓成數(shù)字信號格式。數(shù)字信號格式為8位的十六進制編碼值,如$00。微處理器從ADC端口采集輸入模擬信號范圍從VSS對應的 $00到VDD對應的$FF?;谶@些十六進制編碼,在VSS和VDD之間的輸入電壓呈現(xiàn)出總共256個電平的線性變換。換句話說,輸入電壓越高,十六進制編碼值就越大。

  最困難的地方在于寫匯編代碼實現(xiàn)算法的程序員必須知道不同輸入模擬電平(例如1.6V)對應什么十六進制編碼值。涉及到微處理器規(guī)格,甚至聯(lián)系生產廠商也不能給出滿意的答案。

  然而,本文提出解決這個問題的方案。假定微處理器工作電源電壓為VDD,應用下面這個簡單公式得到十六進制編碼值:VIN/(VDD/255)=result value="hex" code(見編者按)。注意,在更高的十六進制編碼轉換精度之前,必須保證轉換出的十六進制值能夠覆蓋整個模擬信號范圍。下面的例子計算表明了使用已知電源電壓5V的微處理器時,測量輸入模擬信號電壓為1.6V的十六進制編碼值:1.6V/(5V/255)=81.6=82,或者$52。

  編者按:

  作者還提供了兩個附件,一個查詢表(PDF格式)和一個Excel格式的表格,讀者可以對照這些附件與公式相互映證。最后,作者還在“反饋環(huán)”這篇文章為本篇文章提供了一些注釋。

       英文原文:

  Find hex-code values for microcontroller’s ADC voltages

  Ease 8-bit microcontroller programming with a simple formula to calculate hex values of ADC output.

  Harry Gibbens Jr, Deafworks, Provo, UT; Edited by Charles H Small and Brad Thompson -- EDN, 4/12/2007

  This Design Idea is for low-end, eight-pin, flash-memory, 8-bit microcontrollers, such as the MC68HC908QT4A from Freescale, but it would apply to any 8-bit microcontrollers that use the ADC feature. In a nutshell, the ADC converts an input-analog-voltage level to a digital-signal format. The digital-signal format has an 8-bit hex-code value, such as $00. The microcontroller “sees” the input-analog-voltage level from its ADC ports ranging from $00 at VSS to $FF at VDD. Based on those hex-code values, there are a total of 256 ticks. The input voltages between VSS and VDD represent a straight-line linear conversion. In other words, the higher the input voltage, the higher the hex-code value.

  The difficulty is that a programmer who needs to write assembly code for a programming algorithm must know what the hex-code value is for a different input-analog-voltage level—1.6V, for example. Referring to the microcontroller’s specs and even contacting its manufacturers do not yield satisfactory answers.

  However, this Design Idea presents a solution to the problem. Given the microcontroller’s power operating-voltage source, VDD, use the following simple formula to obtain the hex-code value corresponding to an identified input-analog-voltage level: VIN/(VDD/255)=result value="hex" code (see Editor's note). Note that you must round off the result value to a whole number before converting to a hex-code value for better accuracy. The following sample calculation finds the hex-code value for a measured input-analog-voltage level of 1.6V when using a known microcontroller’s VDD of 5V:1.6V/(5V/255)=81.6=82, or $52

  Editor's Note:

  Correction and addition (4/27/2007): Due to an editing error, we originally printed the formula as "VIN×VIN/(VDD/255)." In addition, the author has provided two attachments, a lookup table (PDF) and an Excel spreadsheet that allows you to interact with the formula. Finally, the author has posted some comments in the "Feedback Loop" section for this article.

本站聲明: 本文章由作者或相關機構授權發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內容真實性等。需要轉載請聯(lián)系該專欄作者,如若文章內容侵犯您的權益,請及時聯(lián)系本站刪除。
換一批
延伸閱讀

現(xiàn)代社會對計算能力的需求日益增長。人工智能 (AI) 的飛速發(fā)展推動了數(shù)據(jù)量的爆炸式增長,包括數(shù)據(jù)的創(chuàng)建、處理和存儲。AI已滲透到現(xiàn)代生活的方方面面,從汽車到購物方式無所不在。在工業(yè)領域,邊緣計算改變了制造業(yè),創(chuàng)造了一個...

關鍵字: 微處理器 電源 人工智能

穩(wěn)壓器只能起到穩(wěn)定直流電壓的作用,它無法改變交流電壓的大小和方向,也就無法替代變壓器的作用。而變壓器雖然自身并沒有穩(wěn)壓功能,但是卻能夠改變電壓大小和方向,使得電力設備能夠正常傳輸和分配。

關鍵字: 穩(wěn)壓器 電壓

自舉電路(Bootstrap Circuit)是一種在電子電路中廣泛應用的升壓技術,其核心作用是通過電路自身的工作狀態(tài)提升某個節(jié)點的電壓,而無需增加外部電源電壓。

關鍵字: 自舉電路 電壓

電路保護的意義在于保護電子電路中的元件免受過電壓、過電流、浪涌和電磁干擾等有害因素的影響,從而防止設備損壞,確保電子設備的安全和穩(wěn)定運行??。

關鍵字: 電路保護 電壓

在電子電路中,負電壓的產生通常需要一種特殊的電路配置。然而,有一個簡單的方法可以獲得負電壓,那就是利用運算放大器(Op-Amp)和地線。具體來說,你可以將運算放大器配置為一個反相放大器,其輸入端接地,并通過適當?shù)碾娮韬碗?..

關鍵字: 電壓 運算放大器

一直以來,變壓器都是大家的關注焦點之一。因此針對大家的興趣點所在,小編將為大家?guī)碜儔浩鞯南嚓P介紹,詳細內容請看下文。

關鍵字: 變壓器 電壓 減容

工業(yè)自動化、醫(yī)療電子及精密測試領域,微弱信號的精準采集與處理是系統(tǒng)性能的核心挑戰(zhàn)。以24位Σ-Δ ADC為核心的高精度數(shù)據(jù)轉換系統(tǒng),結合激光修調電阻陣列的微弱信號調節(jié)器,通過動態(tài)元件匹配(DEM)技術與激光微納加工工藝的...

關鍵字: ADC 動態(tài)元件匹配

2025年7月8日,致力于亞太地區(qū)市場的國際領先半導體元器件分銷商---大聯(lián)大控股宣布,其旗下品佳推出基于微芯科技(Microchip)dsPIC33CK256MP506主控MCU的3.3KW雙向圖騰柱PFC逆變電源方案...

關鍵字: 電源 MCU ADC

納祥科技在原來的基礎上更新了一款高性能音頻I2S 114DB ADC,它能夠以高達192kHz的采樣率,執(zhí)行立體聲模擬到數(shù)字轉換,最高支持24位串行值,并具備114dB動態(tài)范圍,-100dB THD+N,功能可覆蓋CS5...

關鍵字: 納祥科技 ADC 國產芯片

專為原電池設計優(yōu)化的超緊湊、高效 PMIC 現(xiàn)已實現(xiàn)量產并開始全球分銷

關鍵字: 電源管理芯片 微處理器 電池
關閉