Mehmet Fide

LC60: SCI / Generating 1 second pulse for calibration

Discussion created by Mehmet Fide on Dec 27, 2007
Latest reply on Jan 8, 2008 by Mehmet Fide
Hi,
 
I'm tring to generate accurate two falling egdes that have 1 second between them. MCU is in FBE mode and fbus=16,384 Hz. I have set baud rate divider to 128 at this bus frequency and send data binary 1 over SCI1. The data sent over TX pin has signal exatcly that I want. There is no problem on there. But eith the code below, RS485 line is disabled about 5.25sec later. Sending operation is not starting immediately I write to SCID register. The function should be completed with in about 1.25second.
 
Code:
void test(void){    DisableInterrupts;        // 8 data, 1 stop, no parity    SCIC1 = 0; SCIC2 = 0; SCIC3 = 0;            SCIBD = 128;  // set baud to 8    SCIC3_TXINV = 1;    SCIC2_TE = 1;        __RESET_WATCHDOG();        ICGC2 = 8; // Generate a reset request on loss of clock.    ICGC1 = 0b00110100;   // FBE mode, fbus=16,384 Hz, clock monitor enabled        while(ICGS1_CLKST != FBE) __RESET_WATCHDOG();        RS485_TX_EN(); // set TXCS pin    SCID = 1; // send a two falling edges have period one second over TX pin    while(!SCIS1_TC) __RESET_WATCHDOG();    RS485_TX_DIS(); // clear TXCS pin        asm("dcb 0x8D"); // reset the mcu   }

 See the gif file for the output of the function.
10x

 


Message Edited by BasePointer on 2007-12-27 10:13 AM

Outcomes