《電子技術應用》
您所在的位置:首頁 > 模擬設計 > 設計應用 > 模擬對數字:架起ADC到處理器的橋梁
模擬對數字:架起ADC到處理器的橋梁
摘要: 當你設計轉換器數字接口時,不要把一切事情視為理所當然。閱讀ADC芯片手冊,核對向數字接口傳輸的位的位置。
Abstract:
Key words :

  作為一個模擬世界的后裔,我經常可以在走廊上聽到些評論,關于數字設計師多么不理解模擬問題。數字設計師們也毫不留情地批評模擬集成電路設計師。這兩個陣營涇渭分明,除非參與者們打破界限,一起進入混合信號領域的研究。

  對典型的模擬精神,不是所有轉換器都用相同的數據格式。一些轉換器用無符號二進制數類型,其他轉換器使用有符號二進制補碼數據。甚至更復雜的問題,轉換器輸出12位或是14位數據,還有16位輸出。還有另一種24位Δ-Σ轉換器技術。

  先不管這些模擬設計結果的目的。對于這些轉換器而言,ADC最低有效位的位置是這些8位、16位或是32位字處理器的第0位。對模擬電路設計者來說,這具有重要意義。然而,12位轉換器的符號位是處理器的位置11。如果分配16位寬度的變量C為轉換器輸出值,假定C符號位是位置15。處理器不能從轉換器識別出負數,所有來自12位的雙極性ADC數據都是正的。因為符號位處于錯誤位置。

  你可以通過幾個步驟來解決這個問題。首先,讀-修改-寫步驟,將處理器寄存器中的數據移位。CPU讀取數據、移動包含數據的寄存器的位到必要的位置,然后將這些數據寫回內存。DSP可以在一個時鐘周期內完成移位。控制器需要很多時鐘周期才能完成移位的過程。如果你選用了這種控制策略,要小心緩存區的不連續性。這意味著緩存區無法辨別DMA控制器是否將新數據寫入內存。結果,CPU將緩存區的舊數據進行移位操作。需要記住的是,無論什么時候向左移了一位,就意味著ADC轉換結果乘了2。

  另一種方式是在處理器循環中將數據右移。這種方式的缺點占用CPU并需要額外指令。另一種選擇是直接將轉換器與處理器的數據總線相連。如果你將12位轉換器的第11位與處理器總線上的第15位相連,那么符號位就會處于正確的位置。然后將數據的第11位到第14位置零來完成數據獲取,否則這些位的數據是不確定的。這種方法只適用于有并行接口。在這種方案中,基于DMA移動就不需要數據移位了。

  使用串行端口的用戶比并行端口的用戶要幸運的多,因為大部分處理器的串行端口提供接收的“左移用零填充至最低有效位”或“右移符號位擴展至最高有效位”特點。這種特色大大減少了CPU處理內存中數據的工作。一些串行端口只工作在接收數據長度是2的冪時,例如16位數據長度。這些端口不能工作在12、14或是24位數據長度時。

  模擬工程師幫助處理處理器接口問題。據我所知,處理器都是8位、16位或是32位的,我從沒聽說過12位或14位的處理器。除非所有的模擬芯片設計者突破界限,否則為轉換器設計數字接口是理所當然的。閱讀ADC數據手冊,核對向數字接口傳輸的位的位置。如果對ADC數據接口做了初始檢查,那么你會因為開始的付出獲得更多成功。

  英文原文:

  Analog versus digital: Bridging the ADC-to-processor divide

  Don’t take things for granted when you are designing the digital interface to a converter. Read the ADC data sheet and verify the bit positions in the transmission across the digital interface.

  By Bonnie Baker -- EDN, 5/10/2007

  As an analog-world descendant, I always hear comments in the hallway about how digital designers don’t really understand analog issues. Digital designers will go so far as to unsympathetically say the same about analog-IC designers. There is no bridge between these two camps unless the participants ride the fence and enter the mixed-signal domain together.

  True to the analog spirit, not all data converters use the same digital format. Some converters use unsigned-binary-data types; other converters use two’s-complement signed data. To even further complicate matters, some converters produce 12- or 14-bit output words, and others produce 16-bit output words. Yet another technology is the 24-bit delta-sigma converter.

 

  Forget the reasons for these analog-design decisions. With all of these converters, the location of the ADC LSB is in the processor’s 0-bit location within the 8-, 16-, or 32-bit word. This situation makes perfect sense to an analog designer. However, the signed-bit of a 12-bit converter resides in position 11

 

in the processor. If you assign a 16-bit-wide C variable to the converter’s output word, C assumes that the sign bit is in position 15. The processor does not recognize a negative number from the converter and assumes that all codes from the 12-bit, bipolar-in ADC are positive. This situation occurs because the signed bit is in the wrong position.

 

  You can approach this problem in several ways. The first, a read-modify-write approach, shifts data in the processor register. The CPU reads the data, shifts the bits in the register containing the data by the necessary amount of bit positions, and writes the data back to memory. A DSP can complete this shift with one cycle. A controller requires many cycles for this shift process. If this strategy is the one you choose, be careful of cache incoherency. Cache incoherency means that the cache is unaware that the DMA controller has placed new words in memory. As a result, the CPU instead shifts the old contents of the cache. It is important to remember that whenever you implement a bit shift to the left, you multiply the ADC results by two.

  Another option is to shift the data into the right position in a processor loop. On the downside, this approach uses the CPU and requires additional MIPS. Another alternative is to directly connect the converter to the processor’s data bus. If you connect bit 11 of the 12-bit converter to bit 15 of the processor’s data bus, the sign bit will then be in the right place. Complete the data-acquisition task by zeroing register bits 11 through 14. Otherwise, these bits are indeterminate. This approach is possible only with parallel interfaces. In this scenario, the DMA-based transfer need not shift data later on.

 

  Serial-port users are more fortunate than parallel-port users because most of the serial ports in processors offer the receiving feature of “left justify and zero fill LSBs” or “right justify and sign-extend MSBs.” This feature significantly reduces the amount of work the CPU

 

must perform once the data is in memory, with one drawback. Some serial ports work only if the received word length is a power of two, such as a 16-bit word length. This receiving feature does not work with 12-, 14-, or 24-bit values.

 

  Analog designers can help with the processor-interface problem. All the processors I know about have 8-, 16- or 32-bit data types, but I have never heard of a 12- or 14-bit data type. Until all of the analog-chip designers take the leap and straddle the fence, don’t take things for granted when you are designing the digital interface to a converter. Read the ADC data sheet and verify the bit positions in the transmission across the digital interface. If you do this initial examination of the ADC’s documented digital interface, you will be more successful with your first spin on the design.

此內容為AET網站原創,未經授權禁止轉載。
主站蜘蛛池模板: 99精品在线观看视频 | 欧美第一页在线 | 久久精品免费观看视频 | 毛片免费毛片一级jjj毛片 | 欧美性受xxxx | 日韩国产欧美成人一区二区影院 | 日本韩国欧美一区 | 国产亚洲精品午夜高清影院 | 99久热| 日批在线 | 中文字幕小明 | 日本三级三级三级免费看 | jizzjizz日本老师 | 亚洲欧美日韩不卡一区二区三区 | 免费观看欧美一级特黄 | a级大片在线观看 | 欧美性猛交一区二区三区精品 | 亚洲香蕉| 日本一区二区三区在线 观看网站 | 99精品欧美| 日韩在线观看一区二区不卡视频 | 一级a毛片免费观看久久精品 | 日本三级香港三级人妇gg在线 | 日韩美女色高清在线看 | 欧美综合图区亚洲综合图区 | 成年男女免费视频 | 亚洲综合丁香 | 亚洲男女免费视频 | 香蕉久久夜色精品国产小优 | 日韩一级黄色大片 | 久久综合九色综合97小说 | 国产三级日本三级在线播放 | 在线观看你懂 | 日韩一级免费视频 | 夜夜夜夜曰天天天天拍国产 | 日韩免费在线视频 | 五月激情婷婷网 | 在线观看免费毛片 | a4yy欧美一区二区三区 | 国产成人高清在线 | 中文字幕日本在线视频二区 |