2013年8月30日 星期五

8051對對VGA控制(AL128

1.目的
2.要求
AL128
一,要求
1.模擬於其demo board的操作
2.移值到不同平台

二,觀察
觀察元件有1.al128 ,2.eeprom, 3.button
一啓動電源後,其動作讀取eeprom中的add 0,1,2的狀態後,
再依其add 1,2的內容之後,向al128寫入對應的資料.
而其四個按鈕來控制其對於vga-in,對s-vido output.
-----------------------------
AL128的操作,共有四個按鈕分別為:
1.pal
2.ntsc
3.VGA-IN
4.EGA-IN
再將此四個按鈕做組合而成的動作,即為al128 demo board動作
因為其VGA-in部份有再分為二種狀態,故vga-in改成:

1.pal
2.ntsc
3.VGA-IN1(vga-in2)
4.EGA-IN
-------------------------------
將其pal,ntsc,vga-in,ega-in分別來代表著bit 0~3
來進行對比,
ps.附件.1
-------------------------------
------------------------------


VGA-IN1 VGA-IN2 EGA-IN
| | |
--------------------------------- ---
|
NTSC
|
---------------------------------
| | |
VGA-IN1 VGA-IN2 EGA-IN
------------------------------------------
VGA-IN1 VGA-IN2 EGA-IN
| | |
--------------------------------- ---
|
PAL
|
---------------------------------
| | |
VGA-IN1 VGA-IN2 EGA-IN
圖.1
ps.
1.先假設其最初的狀態pal-ega-in
2.再由此出發
3.比如按下vga-in1,則變為pal-vga-in1
(ntsc ,則....ega-in-ntsc
-----------------------------------------
-----------------------------------------

PAL_EGA[]={0x01,0x02,0x03,0x18,0x02,0x78,0x50,0x00,0x21,0xF8,0x23,0x32,
0x22,0xFD,0x24,0xB7,0x25,0xB7,0x26,0x1F,0x27,0x40,0x28,0xA1,
0x33,0x02,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1B,0x72,0x1B,
0x51,0xF9,0x52,0xF1,0xFF,0xFF};
PAL2_VGA[]={0x01,0x04,0x03,0x18,0x20,0x00,0x02,0x78,0x50,0x00,0x21,0x06,
0x22,0xFD,0x23,0xB2,0x24,0xCE,0x25,0xC8,0x26,0x1F,0x27,0x80,
0x28,0xBF,0x33,0x01,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x27,
0x72,0x24,0x51,0x06,0x52,0x07,0xFF,0xFF};
PAL1_VGA[]={0x01,0x03,0x03,0x18,0x20,0x00,0x02,0x78,0x50,0x00,0x21,0x02,
0x22,0x02,0x23,0xB2,0x24,0xBE,0x25,0xBC,0x26,0x1F,0x27,0x80,
0x28,0xBB,0x33,0x01,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1F,
0x72,0x1E,0x51,0x00,0x52,0xF2,0xFF,0xFF};
-----------------------------
EGA_PAL[]={0x02,0x01,0x03,0x18,0x02,0x78,0x50,0x00,0x21,0xF8,0x23,0x32,
0x22,0xFD,0x24,0xB7,0x25,0xB7,0x26,0x1F,0x27,0x40,0x28,0xA1,
0x33,0x02,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1B,0x72,0x1B,
0x51,0xF9,0x52,0xF1,0xFF,0xFF};
VGA2_PAL[]={0x02,0x01,0x03,0x18,0x20,0x00,0x02,0x78,0x50,0x00,0x21,0x06,
0x22,0xFD,0x23,0xB2,0x24,0xCE,0x25,0xC8,0x26,0x1F,0x27,0x80,
0x28,0xBF,0x33,0x01,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x27,
0x72,0x24,0x51,0x06,0x52,0x07,0xFF,0xFF};
VGA1_PAL[]={0x02,0x01,0x03,0x18,0x20,0x00,0x02,0x78,0x50,0x00,0x21,0x02,
0x22,0x02,0x23,0xB2,0x24,0xBE,0x25,0xBC,0x26,0x1F,0x27,0x80,
0x28,0xBB,0x33,0x01,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1F,
0x72,0x1E,0x51,0x00,0x52,0xF2,0xFF,0xFF};

//-----------------------------------------
NTSC_EGA[]={0x01,0x02,0x03,0x18,0x02,0x58,0x50,0x00,0x21,0xFF,0x23,0xB2,
0x22,0xFD,0x24,0xB7,0x25,0xB7,0x26,0x1F,0x27,0x80,0x28,0xB7,
0x33,0x02,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1B,0x72,0x1B,
0x51,0xFB,0x52,0xFA,0xFF,0xFF};
NTSC2_VGA[]={0x01,0x04,0x03,0x18,0x20,0x00,0x02,0x58,0x50,0x00,0x21,0xFF,
0x22,0xFC,0x23,0xB0,0x24,0xCE,0x25,0xBC,0x26,0x1F,0x27,0x80,
0x28,0xB4,0x33,0x00,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x27,
0x72,0x1E,0x51,0x02,0x52,0xFA,0xFF,0xFF};
NTSC1_VGA[]={0x01,0x03,0x03,0x18,0x20,0x00,0x02,0x58,0x50,0x00,0x21,0xFF,
0x22,0x02,0x23,0xAD,0x24,0xBE,0x25,0xBC,0x26,0x1F,0x27,0x80,
0x28,0xB4,0x33,0x00,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1F,
0x72,0x1E,0x51,0x02,0x52,0xFA,0xFF,0xFF};
//-----------------------------------------
EGA_NTSC[]={0x02,0x00,0x03,0x18,0x02,0x58,0x50,0x00,0x21,0xFF,0x23,0xB2,
0x22,0xFD,0x24,0xB7,0x25,0xB7,0x26,0x1F,0x27,0x80,0x28,0xB7,
0x33,0x02,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1B,0x72,0x1B,
0x51,0xFB,0x52,0xFA,0xFF,0xFF};
VGA2_NTSC[]={0x02,0x00,0x03,0x18,0x20,0x00,0x02,0x58,0x50,0x00,0x21,0xFF,
0x22,0xFC,0x23,0xB0,0x24,0xCE,0x25,0xBC,0x26,0x1F,0x27,0x80,
0x28,0xB4,0x33,0x00,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x27,
0x72,0x1E,0x51,0x02,0x52,0xFA,0xFF,0xFF};
VGA1_NTSC[]={0x02,0x00,0x03,0x18,0x20,0x00,0x02,0x58,0x50,0x00,0x21,0xFF,
0x22,0x02,0x23,0xAD,0x24,0xBE,0x25,0xBC,0x26,0x1F,0x27,0x80,
0x28,0xB4,0x33,0x00,0x73,0x00,0x40,0x00,0x53,0x00,0x71,0x1F,
0x72,0x1E,0x51,0x02,0x52,0xFA,0xFF,0xFF};

以上分別代表著圖.1中的各種形狀下的所要寫入al128的資料
.偶數add為register number.;奇數則為資料
ex.
VGA1_NTSC[]={0x02,0x00,0x03,0x18,0x20,0x00,0x02,0x58,0x50,0x00,0x21,0xFF,
狀態為vga-in1-ntsc
向0x02 register number 寫入 00
向0x03 register number 寫入 18
向0x20 register number 寫入 00
............
..

------------------------------------------------------------------
三.實作

1.定義以一個exteral object 來記錄目前的狀態
2.讀取其eeprom中的add 01,02,來記錄
3.依其狀態來寫入,但第一筆 並沒 勿略
4.等侍使用者改變其記錄(在此是以button
5.依其狀態來寫入
6.回到步 4.

四,問題
1.對於J3並沒有使用到.它是用於RX,TX.可外接UART

2.因為改變其MCU的,目前是使用Winbound 系列.
若要求支援ISP的功能,則其電路需要改變

3..............................
為了方便於改變其相對應的設定值.
改由以code banking來存取?





沒有留言:

張貼留言