Jump to content

CrappoMan

Members
  • Content Count

    8
  • Joined

  • Last visited

  1. CrappoMan

    Vehicle anti-theft / RFID fob.

    The starter motor should already be relay switched, just need to tap into the feed for the relay coil, along with 2 diodes to prevent back flow into the ecu or your circuit.
  2. CrappoMan

    Can't use EasyMSP Libraries

    You need to #define the type of chip you are using, but don't need to #include the chip specific header file, EasyMSP should take care of that for you. Look at lines 21 & 22 of the 'EasyMSP083BETA1.h' that you are #including. e.g: #define MSP430G2231 #include "EasyMSP083BETA1.h"
  3. CrappoMan

    __delay_cycles on G2553 @ 16Mhz Problem

    I have tried the example code, (btw, didn't know example code was available for the MSP430G2xx3 series, I only had example code for the xx1 and xx2 series). I don't have the 32Khz crystal connected, but that should only affect the ACLK output. At 1Mhz, all checks out ok, got 1Mhz and 100Khz pulse trains. At 16Mhz, I get ~1.6Mhz (1.552Mhz actual) pulses on P1.1: But, a ~16Mhz SINE WAVE (sort of!!!) on P1.4: Is it supposed to be a square wave or is the approx sine wave ok ? Or is the sine wave a byproduct of my scope probe capacitance ?
  4. CrappoMan

    __delay_cycles on G2553 @ 16Mhz Problem

    I dont know either, but I've worked out that the value of R13 is set to "(cycles - 7) / 3". I've tested this with a few different values and it seems to be correct. The value of 100,000, is supplied by 'grace', not by me. I've hooked up my scope (Tektronix 2245A, 100Mhz, Quad trace, with cursors and measurements) and it all works ok if I comment out the __delay_cyles() call in BCSplus_init.c, or I use manual frequency selection with: BCSCTL1 = CALBC1_16MHZ; /* Set DCO to 16MHz */ DCOCTL = CALDCO_16MHZ; It was a struggle getting it to run at 16Mhz using 'grace' and the fact is: IT DOESNT WORK!
  5. CrappoMan

    __delay_cycles on G2553 @ 16Mhz Problem

    I assume you mean that 10,000 cycles is less than the watchdog timeout (32768 cycles), whereas 100,000 cycles is more so the watchdog is firing and interfering, but in my original post, i showed that the watchdog timer is disabled before the calls to __delay_cycles() or CSL_init(), so it cant be the watchdog interrupt interfering with R13. Correct me if i'm wrong.
  6. CrappoMan

    __delay_cycles on G2553 @ 16Mhz Problem

    Yes, a watchdog interrupt and a pin change interrupt. Watchdog is interrupting at ~30ms @ 1Mhz DCO. Don't know about @16Mhz, cos it won't get any further than CSL_init(); The pin change interrupt isn't being used at the moment, until I get the speed working correctly.
  7. I'm having a problem getting my G2553 running at 16Mhz. I'm using grace to set the DCO to 16Mhz. The debugger gets stuck at the __delay_cycles(100000) instruction in BCSplus_init.c: if (CALBC1_16MHZ != 0xFF) { /* Adjust this accordingly to your VCC rise time */ __delay_cycles(100000); /* Follow recommended flow. First, clear all DCOx and MODx bits. Then * apply new RSELx values. Finally, apply new DCOx and MODx bit values. */ DCOCTL = 0x00; BCSCTL1 = CALBC1_16MHZ; /* Set DCO to 16MHz */ DCOCTL = CALDCO_16MHZ; } If i change it to a smaller value, say 10000, it works fine. The function is compiled into this: 31 __delay_cycles(100000); 0xC05E: 120D PUSH R13 0xC060: 403D 8233 MOV.W #0x8233,R13 1_$2: 0xC064: 831D DEC.W R13 0xC066: 23FE JNE (1_$2) 0xC068: 413D POP.W R13 Stepping through the routine, and using the Register Window, I can see that R13 gets loaded with 0x8233 and decremented correctly, but If I press "Run" and then press "Pause", sometimes R13 is smaller and sometimes larger. It never exits the loop as it never gets to zero. This happens both during debugging and running on the chip. If I directly change R13's value to 2, it loops twice and continues correctly. And to make things stranger, if I change the DCO to 1Mhz (to avoid the call to __delay_cycles() in BSCplus_init.c) and add a call to __delay_cycles() in main: void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer __delay_cycles(100000); CSL_init(); // Activate Grace-generated configuration ... The __delay_cycles() call works perfectly ??? Does anyone know why R13 is acting strangely when DCO is set to 16Mhz ? And why it works with a value of 10000 but not 100000 ?
  8. CrappoMan

    Value Line series easy DCO setting library

    Hi everyone, I'm a newcomer to MSP430 programming, so am learning all the time. I understand that the Value Line 'G' series come with only 1 DCO calibration constant, for 1 Mhz. I ordered some samples from TI and got a few IC's. I have checked a 2553 with the disassembler in CCS and it seems to have non 'FF' values for the other 3 constants too: 0x10F8: 8FA3 8EAE SUB.W @R15,0x8eae(R3) 0x10FC: 8DA1 86D7 SUB.W @R13,0x86d7(SP) Does this mean it has already been calibrated ? If that's right, many thanks TI. Cheers Simon
×