main () { SystemInit(); LPC_IOCON->PIO0_7 = (0x0) + (0<<3) + (0<<5); LPC_GPIO0->MASKED_ACCESS[1<<7] = 0; LPC_GPIO0->DIR = LPC_GPIO0->DIR | (1<<7); SysTick_Config(H_LINE_TICKS); // number of ticks to interrupt at 63,5us for (;;); } void SysTick_Handler(void) { H_Sync(); } __inline void H_Sync(void) { // H_sync pulse 4.7us LPC_GPIO0->DATA &= ~(1<<7); asm("push {r1}\n\t" "mov r1, #22\n\t" "Loophs1:\n\t" "subr1, r1, #1\n\t" "cmpr1, #0\n\t" "bneLoophs1\n\t" "pop {r1}\n\t" ); LPC_GPIO0->DATA |= (1<<7); } |
main () { SystemInit(); LPC_IOCON->PIO0_7 = (0x0) + (0<<3) + (0<<5); LPC_GPIO0->MASKED_ACCESS[1<<7] = 0; LPC_GPIO0->DIR = LPC_GPIO0->DIR | (1<<7); LPC_IOCON->PIO0_9 = (0x0) + (0<<3) + (0<<5); LPC_GPIO0->MASKED_ACCESS[1<<9] = 0; LPC_GPIO0->DIR = LPC_GPIO0->DIR | (1<<9); SysTick_Config(H_LINE_TICKS); // number of ticks to interrupt at 63,5us for (;;); } |
main () { SystemInit(); LPC_IOCON->PIO0_7 = (0x0) + (0<<3) + (0<<5); LPC_GPIO0->MASKED_ACCESS[1<<7] = 0; LPC_GPIO0->DIR = LPC_GPIO0->DIR | (1<<7); LPC_IOCON->PIO0_9 = (0x0) + (0<<3) + (0<<5); LPC_GPIO0->MASKED_ACCESS[1<<9] = 0; LPC_GPIO0->DIR = LPC_GPIO0->DIR | (1<<9); asm("nop"); asm("nop"); SysTick_Config(H_LINE_TICKS); // number of ticks to interrupt at 63,5us for (;;); } |
void test_func(int vezes) __attribute__ ((__section__(".data.ramfunc"))); void test_func(int vezes){ asm(//"ldr r0,=40\n\t" "L1:\n\t" "subr0, r0, #1\n\t" "cmpr0, #0\n\t" "bneL1\n\t" ); } |
// Horizontal Equalizing Pulse __inline void H_Eq(void) { // H_equ pulse 2.3us Sync_ON; //LPC_GPIO0->DATA &= ~(1<<7); test_func(14); Sync_OFF; //LPC_GPIO0->DATA |= (1<<7); // wait half line - 2.3us (29.45 us) test_func(250); // Second H_equ pulse 2.3us Sync_ON; //LPC_GPIO0->DATA &= ~(1<<7); test_func(14); Sync_OFF; //LPC_GPIO0->DATA |= (1<<7); } |