⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 big.psm

📁 用FPGA做主控制器
💻 PSM
📖 第 1 页 / 共 4 页
字号:
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1A            ; sub address
                       LOAD     s0C,10            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1B            ; sub address
                       LOAD     s0C,F0            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1C            ; sub address
                       LOAD     s0C,16            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1D            ; sub address
                       LOAD     s0C,01            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1E            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1F            ; sub address
                       LOAD     s0C,3D            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       RETURN


;      ////////////////////////////////
;     //                            //
;    // Values used to initialize  //
;   // decoder (part two)         //
;  //                            //
; ////////////////////////////////

   decoder_part2_NTSC: LOAD     s0A,s10            ; device address

                       LOAD     s0B,20            ; sub address
                       LOAD     s0C,D0            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,21            ; sub address
                       LOAD     s0C,09            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,22            ; sub address
                       LOAD     s0C,8C            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,23            ; sub address
                       LOAD     s0C,E2            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,24            ; sub address
                       LOAD     s0C,1F            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,25            ; sub address
                       LOAD     s0C,07            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,26            ; sub address
                       LOAD     s0C,C2            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,27            ; sub address
                       LOAD     s0C,58            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,28            ; sub address
                       LOAD     s0C,3C            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,29            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,2A            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,2B            ; sub address
                       LOAD     s0C,A0            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,2C            ; sub address
                       LOAD     s0C,CE            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,2D            ; sub address
                       LOAD     s0C,F0            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,2E            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,2F            ; sub address
                       LOAD     s0C,F0            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,30            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,31            ; sub address
                       LOAD     s0C,70            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,32            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,33            ; sub address
                       LOAD     s0C,E1            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,34            ; sub address
                       LOAD     s0C,0F            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,35            ; sub address
                       LOAD     s0C,01            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,36            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,37            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,38            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,39            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,3A            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,3B            ; sub address
                       LOAD     s0C,00            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,44            ; sub address
                       LOAD     s0C,41            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,45            ; sub address
                       LOAD     s0C,BB            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,F1            ; sub address
                       LOAD     s0C,EF            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,F2            ; sub address
                       LOAD     s0C,80            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       RETURN


;     //////////////////////////////
;    //                          //
;   // Switch Handling Routine  //
;  //                          //
; //////////////////////////////


;-----------------------------------------------------------------------
;
; read_switches
;
; Sample switches and build a word in s06 representing the results.
;

        read_switches: LOAD     s05,00            ;
                       LOAD     s06,00            ;

                       INPUT    s05,PAL_EN        ; read switch
                       OR       s06,s05            ; merge with others
                       SL0      s06               ; make room in lsb
                       INPUT    s05,COLOR_BAR_EN  ; read switch
                       OR       s06,s05            ; merge with others
                       SL0      s06               ; make room in lsb
                       INPUT    s05,GAMMA_EN      ; read switch
                       OR       s06,s05            ; merge with others
                       SL0      s06               ; make room in lsb
                       INPUT    s05,GAMMA_SELECT  ; read switch
                       OR       s06,s05            ; merge with others
                       SL0      s06               ; make room in lsb
                       INPUT    s05,SVIDEO_EN     ; read switch
                       OR       s06,s05            ; merge with others
                       LOAD     s0E,s05
                       CALL     report_to_chipscope
                       RETURN                    ; switches are in s06



;      ///////////////////////////////
;     //                           //
;    // Routine to overlay values //
;   //  based on switch changes  //
;  //                           //
; ///////////////////////////////

;-----------------------------------------------------------------------
;
; Update based on switch changes
;
; The switches are stable, so the values are tested and the I2C
; bus is updated appropriately.
;



       switch_changes: LOAD     s07,s06            ; keep a copy of switches
                       AND      s06,10            ; bit 4 is PAL_EN
                       JUMP     Z,NTSC
                       JUMP     PAL

;-----------------------------------------------------------------------
;
; NTSC decoder values and encoder values
;
                 NTSC: LOAD     s06,s07            ; restore s06 from test
                       AND      s06,01            ; bit 0 is SVIDEO_EN
                       JUMP     Z,COMPOSITE
                       JUMP     SVIDEO

;-----------------------------------------------------------------------
;
; NTSC decoder values overlayed with PAL changes
;
                  PAL: LOAD     s06,s07            ; restore s06 from test

                       LOAD     s0A,s10            ; device address

                       LOAD     s0B,1A            ; sub address
                       LOAD     s0C,90            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1B            ; sub address
                       LOAD     s0C,1F            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1C            ; sub address
                       LOAD     s0C,17            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,1F            ; sub address
                       LOAD     s0C,42            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,22            ; sub address
                       LOAD     s0C,7B            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,23            ; sub address
                       LOAD     s0C,E2            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,24            ; sub address
                       LOAD     s0C,A0            ; write data value
                       CALL     I2C_wr_rd        ; write and then verify with read

                       LOAD     s0B,25            ; sub address

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -