2021년 11월 11일 목요일

ATxmega clock Initialize the PLL

  /*

Initialize the PLL

-> 48 MHz output frequency

-> 32 MHz internal oscillator as input

*/

OSC.CTRL |= OSC_RC32MEN_bm;

while(!(OSC.STATUS & OSC_RC32MRDY_bm));

OSC.PLLCTRL = OSC_PLLSRC_RC32M_gc | 0x06;

OSC.CTRL |= OSC_PLLEN_bm;

while(!(OSC.STATUS & OSC_PLLRDY_bm));


CCP = CCP_IOREG_gc; 

CLK.CTRL = CLK_SCLKSEL_PLL_gc;

ATxmega clock Initialize the internal 32 MHz oscillator

  /*

Initialize the internal 32 MHz oscillator

*/

OSC.CTRL |= OSC_RC32MEN_bm;

while(!(OSC.STATUS & OSC_RC32MRDY_bm));

CCP = CCP_IOREG_gc;

CLK.CTRL = CLK_SCLKSEL_RC32M_gc;

ATxmega clock Initialize the internal 2 MHz oscillator

  /*

Initialize the internal 2 MHz oscillator

*/

OSC.CTRL |= OSC_RC2MEN_bm;

while(!(OSC.STATUS & OSC_RC2MRDY_bm));

CCP = CCP_IOREG_gc;

CLK.CTRL = CLK_SCLKSEL_RC2M_gc;

ATxmega clock Initialize the external crystal oscillator

  /*

Initialize the external crystal oscillator

*/

OSC_XOSCCTRL = OSC_XOSCSEL_XTAL_16KCLK_gc | OSC_FRQRANGE_12TO16_gc; 

OSC.CTRL |= OSC_XOSCEN_bm; 

while(!(OSC.STATUS & OSC_XOSCRDY_bm)); 

CCP = CCP_IOREG_gc; CLK.CTRL = CLK_SCLKSEL_XOSC_gc;



/*

Configure the output for the system clock

-> Port C.7

*/

PORTC.DIRSET = (0x01 << 0x07);

PORTCFG.CLKEVOUT |= PORTCFG_CLKOUT_PC7_gc;

2021년 2월 1일 월요일

instance

          Bitmap bmp = (Bitmap)mOriginal.Clone();

        ImageProcessor imgproc = new ImageProcessor(null, fileName, bmp.Size, false);
        imgproc.LinePreview = true;
        imgproc.LineDirection = ImageProcessor.Direction.Vertical;
        imgproc.PreviewVector(bmp);

        pictureBox1.Image = null;
        pictureBox1.Image = bmp;