예제 #1
0
void btest005::program(void)
{
  _DIRA |= (1 << lopin);
  _OUTA |= (1 << lopin);
  do {
    pausems(500);
    _OUTA ^= 0x10000;
  } while (1);
}
예제 #2
0
int main(void)
{
	uint8 i;
	uint8 j;
	uint8 OutputString[10];
	
	pausems(5000);	
	UartSetBaudRate( B2400, PD1, PD0 );

	EEAR = 0x01;
	

	i = 'C';

	EEDR = i;	

	/* Write the letter 'H' to address 0 of 511' */
	asm volatile ("sbi %2, %0\n\t"
		  			  "sbi %2, %1\n\t"
						:
						:"I" (EEMWE), "I" (EEWE), "I" (0x1C)
		  				);

//	utoa(EEDR, OutputString, 10);


	/* Wait until the EEPROM write has completed */
	while( (EECR & (1 << EEWE) ) == 1)
	{;
	
	}

	while(1)
	{	
	EECR |= (1<<EERE);
	pausems(10);
	utoa(EEDR, OutputString, 10);
	serout(OutputString);
	}



}
예제 #3
0
int main(void)
{
	initHardware();

	while (1)
	{
		Board_LED_Toggle(LED);
		pausems(DELAY_MS);
	}
}
예제 #4
0
파일: main.c 프로젝트: pridolfi/workspace
int main(void)
{
    int duty = 100;

    initHardware();

    while(1) {
        pausems(1000);

        duty += 100;
        if(duty == 1000) duty = 100;

        Chip_TIMER_SetMatch(LPC_TIMER1, 1, duty);
        Chip_TIMER_Reset(LPC_TIMER1);
        Chip_TIMER_ClearMatch(LPC_TIMER1, 1);
        Chip_TIMER_ClearMatch(LPC_TIMER1, 0);
    }
}
예제 #5
0
파일: ciaaBlink.c 프로젝트: ciaa/EOPT
int main(void)
{
	volatile int i;

	/* FIXME: SystemCoreClock no se usa con LPC43xx,
	 * pero CGU_GetPCLKFrequency() no sé por qué genera
	 * cuelgues erráticos o hace que SysTick no interrumpa :(
	 */

	SysTick_Config(SystemCoreClock/1000);
    ciaaIOInit();

    while(1)
    {
    	for(i=4; i<8; i++)
    	{
			ciaaWriteOutput(i, 1);
			pausems(100);
			ciaaWriteOutput(i, 0);
    	}
    }
}
예제 #6
0
int main(void)
{
	uartInit(BAUD19200, FAST);

	uint16_t temp;
	
	/*Enable interrupts*/
	sei();
	
	/*Enable receive complete interrupt*/
	UCSRB |=	(1<<RXCIE);
	
	/* performs an echo*/
	
	while(1)
	{
		//uartTxString("I AM HERE\r\n");
		
		pausems(500);	
	}
	
	
	return 0;
}