Jump to content

pillum

Members
  • Content Count

    37
  • Joined

  • Last visited

  1. Thanks, your code did work somehow oPossum.
  2. yes the clock source should be fast enough, 16Mhz SMCLK TA1CTL = TASSEL_2 + MC_2; TA1CCTL1 = CM_3 | SCS | CCIS_0 | CAP | CCIE;
  3. weird, with your version I get 48 for every pulse of different length. Also I cannot use Timer1_A0 only Timer1_A1. It never gets to the ISR of it.
  4. @JWoodrell Is there an advantage of your version to the HW Timer version? @oPossum I get the same value for different frequencies.
  5. reading TAIV didnt change anything but rising the value to 64 now
  6. This gives me 16 variables with exactly the value 59, is that right? looks weird to me (edit: after a 2nd run its 54) Also how do I handle overflows if i'm not going to reset the register everytime?
  7. That would block the cpu for other uses like updating the led driver, wouldn't it?
  8. Hello, I want to measure the time between the both edges of clock signal. The Purpose of the project is to build a shift light with the MSP430 and the TLC5940 LED driver. The RPM signal to the tachometer comes in a 12V HIGH/LOW signal and the higher the RPM is the higher the frequency of the signal is. Instead of using a frequency counter I measure the time the signal is on HIGH. Capturing the signal with the Open Logic Sniffer gave me a straight and continuous signal. 2 MSP430s are used. One to generate the signal and the other to measure it. MSP430 #1 P1.0 -> MSP430 #2 P2.1 This is the code for generating the clock: void main(void) { WDTCTL = WDTPW + WDTHOLD; DCOCTL = CALDCO_16MHZ; BCSCTL1 = CALBC1_16MHZ; P1DIR = BIT0; P1OUT = 0x00; TACTL = TASSEL_2 | MC_1 | ID_0; CCR0 = 8000; CCTL0 = CCIE; _enable_interrupts(); _bis_SR_register(LPM0 | GIE); } #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer_A (void) { P1OUT ^= BIT0; // Toggle P1.0 } This is the code for measuring it: void main() { /* Clock Setup */ WDTCTL = WDTPW + WDTHOLD; // Stop WDT // Set Clock Frequency to 16Mhz BCSCTL1 = CALBC1_16MHZ; DCOCTL = CALDCO_16MHZ; P2SEL = BIT1; P1DIR = 0x00; TA1CTL = TASSEL_2 + MC_2; TA1CCTL1 = CM_3 | SCS | CCIS_0 | CAP | CCIE; _enable_interrupts(); for(; ; } #pragma vector=TIMER1_A1_VECTOR __interrupt void TimerA1(void) { timer = TA1CCR1; TA1CTL |= TACLR; TA1CCTL1 &= ~(COV | CCIFG); } (I even tried to set the check to positive edge and in the ISR set the check to negative edge so its only measuring the HIGH signal time.) Sometimes I get values around CCR0 (8048, 8079, ..) but mostly its trash (0, 33152, 5000, 6915, ...). Whats wrong? Thank you
  9. edit: seems like my 1.3 Pin is broken now. simple main.c with only activating it, gives GND on it
  10. pillum

    TLC5940 examples

    Is there a reason you are latching in new gs data before you update it in the ISR ? Wouldn't otherwise be more reasonable and faster in terms of latency?
  11. Hmmm, can I use GND as Low? VPRG can be either GND or VCC but DCPRG can be either L or H..is there any difference? Because I really dont know whats not working again, all the signals and connections are checked and are all right
  12. The first cycle flag. According to the Programing Flowchart you need to pulse SCLK the first time you updated GS data.
  13. Cr*p...happens again. This time everythings soldered so no flaky breadboard connection. Do I need to update DC register before updating GS register? Also, do I need the first cycle flag when not updating it? VPRG and DCPRG are grounded and not controlled by MSP this time since I'm using the DC data from EEPROM. Sniffer tells me, that there is a (clocked) current flowing through OUTn (strangely also on TLCs not connected to the MSP). But the LEDs are pretty dark to off using the same old resistor with value of 1.91kOhm
  14. How accurate is it at the fastest mode and how fast is the fastest mode of that chip?
  15. pillum

    TLC5940 board

    I would be interested in a version with three TLC5940 for RGB LEDs if there will be one anytime.
×
×
  • Create New...