CLC peripheral on PIC16LF1503

Discussion in 'Embedded Systems and Microcontrollers' started by selfbg, Apr 18, 2012.

  1. selfbg

    Thread Starter Member

    Jun 11, 2010
    23
    0
    I need some help with the new CLC peripherial. I'm making some kind of router (repeater). The signal on CLC1IN1 is repeated to CLC1. No matter what I do, I can't get it right. I'm using the CLC design tool by Microchip, but still - epic fail. :) I'm looking for example that really WORKS. :rolleyes:
    [​IMG]
    Here is my code:

    Code ( (Unknown Language)):
    1.  
    2. .......
    3. static char Init_CLC(){
    4. APFCONbits.CLC1SEL = 1; //CLC1 on RC5
    5. CLC1CONbits.LC1EN = 0; //Disable CLC1
    6. ANSELA = 0;
    7. ANSELC = 0; //All pins digital
    8. TRISAbits.TRISA5 = 1; //RA5 - Input - CLC1IN1
    9. TRISCbits.TRISC5 = 0; //RC5 - Output - CLC1
    10. //Configuration bits from CLC designer Tool  
    11. CLC1GLS0 = 0x02;
    12. CLC1GLS1 = 0x00;
    13. CLC1GLS2 = 0x00;
    14. CLC1GLS3 = 0x00;
    15. CLC1SEL0 = 0x01;
    16. CLC1SEL1 = 0x00;
    17. CLC1POL  = 0x02;
    18. CLC1CON  = 0xC0;
    19. }
    20. .........
    21.  
    22.  
    Thank in advise for the help :)
     
    Last edited: Apr 18, 2012
  2. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    How about feeding gate 1 and gate 2 with that signal and getting rid of the NOT output on gate 2?
     
  3. selfbg

    Thread Starter Member

    Jun 11, 2010
    23
    0
    I've tried all possible combinations but still no good. The one that I use is from Microchip's designer guide PDF, so I assume that it works. :) Maybe the problem is with input gates. When I change the output polarity the CLC1 pin set.
     
Loading...