亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? adc_ctrl.psm

?? 和picoblaze完全兼容的mcu ip core
?? PSM
?? 第 1 頁 / 共 5 頁
字號:
                    CALL LCD_reset                      ;initialise LCD display
                    ;
                    ;Write welcome message to LCD display
                    ;
                    LOAD s5, 10                         ;Line 1 position 0
                    CALL LCD_cursor
                    CALL disp_PicoBlaze                 ;Display 'PicoBlaze Inside'
                    LOAD s5, 23                         ;Line 2 position 3
                    CALL LCD_cursor
                    CALL disp_ADC_Control
                    CALL delay_1s                       ;wait 5 seconds
                    CALL delay_1s
                    CALL delay_1s
                    CALL delay_1s
                    CALL delay_1s
                    CALL LCD_clear                      ;Clear display
                    ;
                    LOAD s0, 00                         ;clear event counter
                    STORE s0, sample_count
                    ;
                    ;
                    ;
                    ;
                    LOAD s0, 01                         ;set initial amplifier gain to 1 on both channels
                    STORE s0, amp_A_gain
                    STORE s0, amp_B_gain
                    JUMP new_gain_set                   ;set, display the initial gain and enable interrupts
                    ;
                    ;
                    ;The program is interrupt driven to maintain an 8KHz sample rate. The main body
                    ;of the program waits for an interrupt to occur. The interrupt updates all four
                    ;analogue outputs with values stored in scratch pad memory. This takes approximately
                    ;58us of the 125us available between interrupts. The main program then prepares
                    ;new values for the analogue outputs (in less than 67us) before waiting for the
                    ;next interrupt.
                    ;
                    ;
        warm_start: LOAD sF, FF                         ;flag set and wait for interrupt to be serviced
                    ENABLE INTERRUPT                    ;normal operation
          wait_int: INPUT sE, switch_port               ;test for button press changes to amplifier gain
                    TEST sE, BTN_north                  ;sE used as this in not effected by ISR
                    JUMP NZ, gain_increase
                    TEST sE, BTN_south
                    JUMP NZ, gain_decrease
                    COMPARE sF, FF                      ;wait for interrupt
                    JUMP Z, wait_int                    ;interrupt clears the flag
                    ;
                    ;
                    ;
                    ;Drive LEDs with simple binary count of the samples to indicate
                    ;that the design is active.
                    ;
                    FETCH s0, sample_count              ;increment counter
                    ADD s0, 01
                    STORE s0, sample_count
                    OUTPUT s0, LED_port                 ;count increments at 1Hz
                    ;
                    ;
                    ;Display the A/D Channel 0 value as hex on LCD
                    ;
                    LOAD s5, 2C                         ;Line 2 position 12
                    CALL LCD_cursor
                    FETCH s0, ADC0_msb
                    CALL disp_hex_byte
                    FETCH s0, ADC0_lsb
                    CALL disp_hex_byte
                    ;
                    ;
                    ;
                    ;Convert A/D channel 0 value to decimal voltage
                    ;
                    ;The 14-bit signed value from the A/D (sign extended to 16-bits)
                    ;relates to a voltage in the range -1.25v to +1.25v at the input
                    ;to the A/D converter relative to the 1.65v mid-rail reference point.
                    ;
                    ;The 14-bit value can be translated into the -1.25v to +1.25v using the
                    ;simple equation...
                    ;
                    ;   ADin = AD_value x 1.25/8192
                    ;
                    ;It is possible to scale the AD_value by 1.25/8192 using a fixed point
                    ;representation.
                    ;
                    ;However, it is also possible to scale it by another factor at the
                    ;same time which nicely converts to a binary value which is readily
                    ;converted to decimal. This can be achieved by example...
                    ;
                    ;For an input to the A/D converter of +1.25v relative to the reference,
                    ;the A/D will output the maximum conversion of 1FFF (+8191).
                    ;
                    ;In this case we would like to have the result value +1.250v which can be represented
                    ;by the integer value +1250 with appropiate positioning of the decimal point.
                    ;The constant to achieve this conversion is +1250/8191=+0.152606...
                    ;Also a number requiring fixed point representation but how many bits to use?
                    ;
                    ;The way to resolve this is to realise that a multiplication will be
                    ;performed and it would be nice if the +1250 result ended up in a register pair.
                    ;So if we perform a 16x16-bit multiplication such that the upper 16-bits of
                    ;the 32-bit result is the required value, then everything will resolve itself.
                    ;
                    ;Hence the constant required is actually (1250x(2^16))/8191=+10001 (2711 hex).
                    ;
                    ;Using the example 1FFF x 2711 = 04E1F8EF
                    ;   of which the upper 16-bits = 04E1 (+1249 decimal)
                    ;
                    ;Likewise the other limit case is E000 x 2711 = FB1DE000
                    ;   of which the upper 16-bits = FB1D (-1251 decimal)
                    ;
                    ;The values can be made perfect by rounding before truncation
                    ;
                    FETCH s2, ADC0_lsb                  ;Read A/D channel 0 value
                    FETCH s3, ADC0_msb
                    LOAD s0, 11                         ;scaling value for input to A/D converter
                    LOAD s1, 27
                    CALL mult_16x16s                    ;[s7,s6,s5,s4]=[s3,s2]x[s1,s0]
                    SL0 s5                              ;round value before truncation
                    ADDCY s6, 00
                    ADDCY s7, 00
                    ;
                    ;The register pair [s7,s6] now holds the binary value
                    ;representing the input level to the A/D converter in milli-volts.
                    ;This is now displayed on the LCD. Negative values need to be converted to
                    ;signed magnitude for display.
                    ;
                    LOAD s5, 20                         ;Line 2 position 0
                    CALL LCD_cursor
                    CALL disp_AD                        ;display A/D=
                    TEST s7, 80                         ;test sign bit of value
                    JUMP NZ, neg_AD
                    LOAD s5, character_plus
                    JUMP AD_sign
            neg_AD: XOR s6, FF                          ;complement [s7,s6] to make positive
                    XOR s7, FF
                    ADD s6, 01
                    ADDCY s7, 00
                    LOAD s5, character_minus
           AD_sign: CALL LCD_write_data                 ;display sign of value
                    CALL disp_volts                     ;display 4 digit value as X.XXXv
                    ;
                    ;Convert A/D channel 0 value to display the VINA decimal voltage
                    ;
                    ;The same fundamental technique can be used to convert the 14-bit
                    ;A/D value into the level at the VINA input except that two more factors
                    ;must be considered.
                    ;
                    ;The first is that the amplifier inverts and has gain. Therefore the
                    ;VINA input level is opposite polarity and could be a smaller deviation
                    ;from the mid rail 1.65v reference.
                    ;
                    ;Secondly, to display the actual voltage level at the VINA terminal
                    ;the 1.65v offset must be added.
                    ;
                    ;The voltage at the VINA input is therefore...
                    ;
                    ;   VINA = [AD_value x (1.25/(8192 x G))]+1.65
                    ;
                    ;Following the same methodology as for the A/D value, it means that there
                    ;is a set of scaling factors to deal with the negative gain values.
                    ;
                    ; K = (+1250 x (2^16)) / (8191 x G)
                    ;
                    ;        G             K     (K Hex)
                    ;       -1          -10001   (D8EF)
                    ;       -2           -5001   (EC77)
                    ;       -5           -2000   (F830)
                    ;      -10           -1000   (FC18)
                    ;      -20            -500   (FE0C)
                    ;      -50            -200   (FF38)
                    ;     -100            -100   (FF9C)
                    ;
                    FETCH s2, ADC0_lsb                  ;Read A/D channel 0 value
                    FETCH s3, ADC0_msb
                    FETCH s4, amp_A_gain                ;read A gain and select appropiate gain setting
                    LOAD s0, EF                         ;scaling value for amplifier gain of -1
                    LOAD s1, D8
                    COMPARE s4, 01
                    JUMP Z, mult_VINA
                    LOAD s0, 77                         ;scaling value for amplifier gain of -2
                    LOAD s1, EC
                    COMPARE s4, 02
                    JUMP Z, mult_VINA
                    LOAD s0, 30                         ;scaling value for amplifier gain of -5
                    LOAD s1, F8
                    COMPARE s4, 03
                    JUMP Z, mult_VINA
                    LOAD s0, 18                         ;scaling value for amplifier gain of -10
                    LOAD s1, FC
                    COMPARE s4, 05
                    JUMP Z, mult_VINA
                    LOAD s0, 0C                         ;scaling value for amplifier gain of -20
                    LOAD s1, FE
                    COMPARE s4, 06
                    JUMP Z, mult_VINA
                    LOAD s0, 38                         ;scaling value for amplifier gain of -50
                    LOAD s1, FF
                    COMPARE s4, 01
                    JUMP Z, mult_VINA
                    LOAD s0, 9C                         ;scaling value for amplifier gain of -100
                    LOAD s1, FF
         mult_VINA: CALL mult_16x16s                    ;[s7,s6,s5,s4]=[s3,s2]x[s1,s0]
                    SL0 s5                              ;round value before truncation
                    ADDCY s6, 00
                    ADDCY s7, 00
                    ADD s6, VREF_lsb                    ;add 1.65v offset represented at 1650 (0672 hex)
                    ADDCY s7, VREF_msb
                    ;
                    ;The register pair [s7,s6] now holds the binary value
                    ;representing the VINA input level in milli-volts.
                    ;This must be a positive value due to the offset of 1.65v
                    ;being greater than the maximum relative range of -1.25v to +1.25v.
                    ;This binary value can now be converted to a decimal digits
                    ;and displayed on the LCD.
                    ;
                    ;If the A/D value is maximum negative (E000) or maximum positive (1FFF)
                    ;then an indication of the actual value being applied being greater or
                    ;less than that computed will be made.
                    ;
                    LOAD s5, 17                         ;Line 1 position 7
                    CALL LCD_cursor
                    CALL disp_VA                        ;display VA=
                    FETCH s2, ADC0_lsb                  ;Read A/D channel 0 value
                    FETCH s3, ADC0_msb
                    COMPARE s3, E0                      ;test for maximum negative
                    JUMP NZ, test_max_pos
                    COMPARE s2, 00
                    JUMP NZ, test_max_pos
                    LOAD s5, character_greater_than     ;display >
                    CALL LCD_write_data
                    JUMP disp_VINA_volts
      test_max_pos: COMPARE s3, 1F                      ;test for maximum positive
                    JUMP NZ, disp_VINA_volts
                    COMPARE s2, FF
                    JUMP NZ, disp_VINA_volts
                    LOAD s5, character_less_than        ;display <
                    CALL LCD_write_data
   disp_VINA_volts: CALL disp_volts                     ;display 4 digit value as X.XXXv
                    JUMP warm_start

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
九九九精品视频| 天天爽夜夜爽夜夜爽精品视频| 久久久激情视频| 亚洲天堂2016| 日本欧美一区二区| 色琪琪一区二区三区亚洲区| 欧美丰满嫩嫩电影| 国产精品毛片无遮挡高清| 日本va欧美va精品发布| 成人av资源在线| 日韩欧美国产综合一区| 在线看日本不卡| 欧美中文字幕一区二区三区 | 国产白丝精品91爽爽久久| 欧美性生活久久| 国产日韩欧美a| 日韩成人免费电影| 在线这里只有精品| 国产精品久久久久aaaa| 国产乱子伦视频一区二区三区| 欧美日韩高清一区二区三区| 亚洲欧美日韩国产综合| 丁香六月综合激情| 精品国产不卡一区二区三区| 午夜av区久久| 色哟哟国产精品免费观看| 欧美激情中文字幕| 国产精品一区二区久久不卡| 欧美一区二区三区影视| 三级欧美在线一区| 欧美精品三级日韩久久| 偷拍一区二区三区四区| 91成人在线免费观看| 国产精品入口麻豆原神| 国产成人精品1024| 国产欧美日韩在线观看| 国产精品一区二区男女羞羞无遮挡| 精品国产乱码久久久久久免费| 首页亚洲欧美制服丝腿| 91视频国产资源| 亚洲免费在线视频一区 二区| 99精品久久免费看蜜臀剧情介绍| 国产精品久久久一本精品 | 亚洲精品一区二区三区精华液| 视频一区欧美精品| 欧美日韩国产一区| 日韩精品久久久久久| 欧美一区二区三区系列电影| 日产国产高清一区二区三区| 这里只有精品免费| 精品无码三级在线观看视频| 国产精品久久久一本精品 | 91精品福利在线| 一区二区三区四区在线| 色94色欧美sute亚洲线路二| 亚洲免费观看视频| 欧美少妇bbb| 日本v片在线高清不卡在线观看| 91精品黄色片免费大全| 国产在线精品一区二区不卡了 | 成人免费一区二区三区在线观看| 91视视频在线观看入口直接观看www| 中文字幕一区二区视频| 欧美综合一区二区| 日本女优在线视频一区二区 | 91九色最新地址| 免费日韩伦理电影| 欧美激情一区三区| 欧美午夜精品久久久久久孕妇| 免费成人结看片| 中文字幕巨乱亚洲| 欧美肥胖老妇做爰| 成人av资源站| 日本欧美大码aⅴ在线播放| 国产精品免费网站在线观看| 欧美日韩在线精品一区二区三区激情 | 久久av资源网| 中文字幕在线免费不卡| 日韩一区二区三区av| 成人一区二区视频| 午夜视频在线观看一区二区三区| 久久日一线二线三线suv| www.激情成人| 天堂精品中文字幕在线| 国产精品区一区二区三| 欧美日韩国产大片| 国产91丝袜在线播放0| 日韩福利视频网| 欧美在线一区二区三区| 免费人成精品欧美精品| 亚洲色欲色欲www| 久久香蕉国产线看观看99| 欧美视频精品在线| 成人短视频下载| 六月丁香婷婷色狠狠久久| 一区二区三区国产精华| 国产欧美日韩综合精品一区二区 | 91精品国产欧美一区二区18| 91免费视频观看| 成人免费视频一区| 九九国产精品视频| 肉肉av福利一精品导航| 一区二区三区四区亚洲| 国产女主播在线一区二区| 欧美一区二区精品久久911| 91久久精品一区二区三区| 成人精品一区二区三区四区 | 亚洲欧洲av在线| 久久久噜噜噜久噜久久综合| 91精品午夜视频| 欧美精选一区二区| 欧美日韩一区二区在线观看| 色呦呦国产精品| 成年人午夜久久久| 国产suv精品一区二区883| 国内精品免费在线观看| 免费在线成人网| 老司机免费视频一区二区| 日日欢夜夜爽一区| 天堂一区二区在线| 亚洲成人黄色影院| 欧美一区二区三区婷婷月色| 欧美日韩综合在线| 欧美色图免费看| 91在线精品秘密一区二区| 国产自产高清不卡| 狠狠色狠狠色综合日日91app| 久久狠狠亚洲综合| 理论电影国产精品| 国产在线视频精品一区| 国产成人免费视频网站| 成人av在线影院| 91在线观看免费视频| 一本一道久久a久久精品综合蜜臀| 99久久久国产精品| 色悠悠亚洲一区二区| 欧美日韩1234| 欧美成人精品二区三区99精品| 久久久美女艺术照精彩视频福利播放| 国产亚洲精品aa午夜观看| 国产精品国产精品国产专区不蜜| 亚洲免费在线播放| 日本麻豆一区二区三区视频| 狠狠色2019综合网| av亚洲产国偷v产偷v自拍| 色噜噜夜夜夜综合网| 91精品在线一区二区| 久久久亚洲精华液精华液精华液| 国产精品视频在线看| 亚洲成a人v欧美综合天堂下载 | 色综合天天视频在线观看| 欧美日韩黄视频| 久久九九久精品国产免费直播| 国产精品乱码一区二区三区软件 | 亚洲3atv精品一区二区三区| 日本中文在线一区| 懂色av一区二区三区免费看| 91高清视频在线| 日韩欧美精品三级| 在线视频中文字幕一区二区| 欧美一区二区三区日韩| 久久久av毛片精品| 亚洲综合另类小说| 国产一区二区伦理| 欧美三级三级三级爽爽爽| 欧美精品一区二区精品网| 亚洲日本va午夜在线影院| 麻豆精品视频在线| 一本色道久久综合精品竹菊| 欧美成人女星排名| 亚洲欧洲国产专区| 极品少妇一区二区| 欧美亚洲一区二区在线观看| 国产欧美一区二区精品秋霞影院| 视频一区视频二区中文| 成人丝袜18视频在线观看| 欧美精品一级二级三级| 国产精品蜜臀av| 黑人巨大精品欧美黑白配亚洲| 在线观看日韩国产| 国产精品福利电影一区二区三区四区 | 日韩国产欧美在线播放| 韩日av一区二区| 欧美肥妇free| 一个色综合av| 91丨porny丨户外露出| 国产欧美一区二区精品忘忧草 | 6080日韩午夜伦伦午夜伦| 欧美激情资源网| 国产成人在线网站| 久久日韩精品一区二区五区| 日韩vs国产vs欧美| 欧美日本一区二区| 亚洲国产欧美一区二区三区丁香婷| 成人av电影在线播放| 久久亚区不卡日本| 久久国产视频网| 国产在线麻豆精品观看| 日韩一区二区三区电影在线观看 | 99精品国产99久久久久久白柏 |