먹고살기/-- HDMI

OSD IC MB90050 control

조용함 2007. 10. 5. 16:49
 

OSD IC MB90050 Control

 

1. 개요

요즘은 이런 VCR기반의 OSD IC를 찾는 것은 매우 어렵다.. 그중에서도  많은 character를 display하고자 한다면 더더욱 힘들것이다. MB90050은 35*16을 지원한다.하지만 character가 너무 작아서, 35 * 11 로 구

현 하고자 한다.

 

2. 필요한 port.

Sio 통신을 이용하는데 MB90050으로부터 regster값은 읽어 들일수 없    다. CLK,DATAOUT,Chip_select,BUSY,Sync_detect_input 5 단자를 이용한다.

 

3. data out routine

 

   void   osd_putword(int a)

  {        

int           x,i;

 

           SIO_CS = 0;   // chip select  low

           x = 16;

           do {

                      SIO_CK = 0;

                           if(a & 0x8000){                      // MSB first

                                 SIO_DO = 1;

                      }else{

                                 SIO_DO = 0;

                      }

                      a = a << 1;

                      /* 데이타 셋팅 시간 */

                     delay(6);

                      SIO_CK = 1;   //clock high edge에서 data detect.

                      delay(2);

                      --x;

           } while   ( x != 0 );

           SIO_CS = 1;   // cs high

     }

 

4.      동작에 필요한 몇몇 register설명

a.  line별 attribute를 지정하고 space로 fill하는 routine.

   void MB90050_AllErase(void)

{

          int i,j,k;

          osd_putword(0x5040);    // OSD display Off

         k = 0x0000;

          for(j=0;j<12;j++){

               osd_putword(k);        // line별로 attribute를 미리지정,12line

              k += 0x100;

               osd_putword(0x4a00);  // length more

          }

          osd_putword(0x0080);   // 처음부터 space_bar로 memory를 fill함.

          osd_putword(0x2100);

     }

b.       초기화 루틴

void MB90050_Init(void)

{

       MB90050_AllErase();

       osd_putword (0xb080);  // internal sync

       osd_putword (0x7e00); // background color

       osd_putword (0x140f);

       // panel의 위치조정

       osd_putword (0x5812); // y panel

       osd_putword (0x5c22); // x panel

      

       osd_putword (0x54f0); // blinking control define.

      

       osd_putword (0x4a00);    // y length 크게

       osd_putword (0x6a00); // transparency control on

       // sync detect가 active low가 되도록 control

       osd_putword(0xbc33); // sync detect control enable

       osd_putword(0xc200); // sync start output enable

       osd_putword(0xc600); // sync output active low

       osd_putword(0xca00); // sync start output pull up

}

c.       background,foreground의 색깔지정

  void osd_SetInvert(void)

         {

       osd_attrib = 1;

       osd_putword(0x15f1);   // 흰색 바탕의 검정 글씨

 }

void  osd_ClearInvert(void)

 {

         osd_attrib = 0;

        osd_putword(0x140f);  // 검정 바탕의 흰색 글씨.

      }

 

 

d.       OSD display on/Off.

void       osd_DisplayOn(void)

{

       osd_DspOn = 1;

       osd_putword (0x5050);

}

     void         osd_DisplayOff(void)

{

      osd_DspOn = 0;

      osd_putword (0x5040);

}

e.       OSD postion

     void MB90050_SetPosition(int x,int y)

     {

        int addr;

 

         addr  = 0x0000;

         addr = y << 8;

         addr |= x;

         osd_putword(addr)

}

 

 

 

f.        OSD character display

// character write

void MB90050_PutChar(int data)

   {

    osd_putword(0x2000 | data);

   } 

  // ascii code를 MB90050 font table에 맞게 조정

  unsigned int osd_ccvt(unsigned char a)

  {      

     unsigned int font;

    

     font = 0;

     if(a == 0x20) {

     font = 0x00;

     }else{

     font = a - 1;

     }

     font = font + 0x100;

     return font;

 }

  // 원하는 위치에 원하는 attribute를 가지고 한글자 기록    

  MB90050_SetChar(int attr,int x,int y, char ch)

 {

    if(attr == 0){

            osd_ClearInvert();

}else{

     osd_SetInvert();

}

MB90050_SetPosition(x,y);

MB90050_PutChar(osd_ccvt(ch));

 

 

}

 

g.      video sync유무에 따른 superimpose on/off

 

static unsigned char sync = 1;

void sync_detect(void)

{

        if(SIO_SYNC == 0){

              if(sync == 1) {

                  osd_putword(0xb282); // superimpose on

                  sync = 0;

             }

   }else{

         if(sync == 0){

              osd_putword(0xb080); // superimpose off

              sync =  1;

         }

    }

}        

 

이상 MB90050을 사용하기 위한 기본적인 control에 대해 검토 해보았다

.