Jump to content
43oh

oPossum

Members
  • Content Count

    925
  • Joined

  • Last visited

  • Days Won

    103

Everything posted by oPossum

  1. TA0CCR0 = 22; // Count limit Bump that to 100 or higher You are very close to ISR overhead at 23 cycles.
  2. Try using #include <msp430.h> instead of the device specific header file. What compiler are you using? Some early versions of MSPGCC may not support _enable_interrupts().
  3. _BIS_SR(LPM0_bits + GIE); // Enable interrupts You are going in to low power mode 0 and doing nothing to exit - so the main() code just halts right there. try this instead... _enable_interrupts(); // Enable all interrupts
  4. C2000 and the older Stellaris M3 also use FT2232H. It is part of the XDS-100 reference design. http://processors.wiki.ti.com/index.php/XDS100
  5. It is a limitation of the G2553. You can see what each pin is capable of in the Port Schematics section of the G2553 spec sheet (SLAS735).
  6. This can be made a bit more efficient by using the C standard library function div(). It will provide the quotient (/) and remainder (%) with a single math operation rather than two. For example, for two digits... div_t d = div(n, 10); text_buffer[0] = '0' + d.quot; // tens text_buffer[1] = '0' + d.rem; // ones For three digits... div_t d = div(n, 100); text_buffer[0] = '0' + d.quot; // hundreds d = div(d.rem, 10); text_buffer[1] = '0' + d.quot; // tens text_buffer[2] = '0' + d.rem; // ones For four digits... div_t d = div(n, 1000); text_buffer[0] = '0' + d.quot; // thousands
  7. You need to have #include <msp430.h> at the top of your source file to have access to the MSP430 registers.
  8. Using a 74HC238 to limit transmission to only one module may be helpful. With all of them sending all of the time there may be problems with echos from the transmissions of other modules.
  9. Turning off interrupts does not stop the timer output from toggling. So you are enabling the next sensor at some time within the timer period. The exact time will keep shifting in and out of sync. The fix is to change the sensor mux in the timer overflow interrupt when the output is low. Give this a try... #include <msp430.h> #include <stdint.h> static const unsigned long smclk_freq = 16000000UL; // SMCLK frequency in hertz static const unsigned long bps = 9600UL; // Async serial bit rate static uint32_t upd = 0; // Ultrasonic P
  10. Should be TA1R instead of TA1CCR. Thanks for finding that bug.
  11. Use RRA instead of RRC, then you don't need CLRC.
  12. I reinvent the wheel to make it smaller, faster, and smoother.
  13. The usual way to generate PWM with the MSP430 is to set the timer to up mode, CCR0 to the PWM period, and then use CCR1 and up in reset/set mode to set the PWM pulse width. This provides a precise hardware driven PWM with minimal CPU overhead. The only ISR required is the CCR0 interrupt so new PWM values can be updated without creating glitches. It is possible to use CCR0 to do PWM in addition to CCR1 and up by using continuous mode and output compare toggle mode. This requires an ISR for each CCR used. It is glitch free and allows different PWM periods for each output if desired. The
  14. I think that would work. Range could be up to about 20 feet if a modulated (~38 kHz) carrier is used. It should work about as well as a TV remote - not perfect but good enough for some applications.
  15. Started with the RCA CDP1802 in the early 80's, then the Motorola 6809 and Zilog Z80. After that is quite a blur - learned so many over the next 10 years. Started using PIC in the late 80's. Latest chip for me is the Parallax Propeller - it is very nice but not easy to work with. Several things related to building a quadcopter. There will be future postings on conversion of old PPM RC radios to PCM. This post was just the first step. Next up will be TMS (transition minimized signaling) using a 8b/11b code I have developed. Also working on a MIDI driven laser spirograph. Have to
  16. PPM (pulse position modulation) is a common protocol used with radio control. It used to be the over that air protocol, but has been mostly replaced with PCM (pulse code modulation). It lives on in the form of trainer ports, radio to tx module link, and even some modern PCM receivers can output PPM (typically on the battery connector). It is also a handy way to drive up to 8 servos using a single pin of the microcontroller (and a CD4017 decoder). PPM is sort of a concatenation of several (often 8) RC servo signals in succession. The time between narrow (a few hundred microseconds) pulses deter
  17. 3) Would typically require the use of global variables - ugly 4) Typically dwarfed by other overhead 1 & 5) It's C++, so yes, a bit verbose - at least it's not Java!
  18. Something that is standard and portable is C++ member function pointers. Each state has it's own member function and the state variable points to one of them. The state machine itself is neatly wrapped in a class.
  19. Some common parts on IIC/SPI: EEPROM http://www.microchip.com/serialeeprom/ RTC http://www.microchip.com/realtimeclock/ ADC http://www.microchip.com/analog-digital-converters/ DAC http://www.microchip.com/dac-digital-potentiometers/ GPIO http://www.microchip.com/serialperipherals/ RAM http://www.microchip.com/serialsram/ Flash http://www.microchip.com/flashmemory/ FRAM http://www.cypress.com/?id=4984
  20. Yes, you have to use 3 wire mode and a normal IO pin to select your SPI slave device.
  21. Make sure UCxSTE is the proper level to allow transmission. 4 pin mode is for multi-master operation and is very rarely used.
  22. The lesson here is you should always explicitly init all IO. Don't assume any IO will be in a know state on power up or reset. This is not retained code, but rather retained state.
  23. This code was written when the MSP430 Lauchpad shipped with chips that had 128 bytes of RAM, 2k of flash, and no hardware serial port. So it was important to keep code very compact and a software UART was needed. Your F6137 chip has many hardware UARTS - so it would be wise to use them rather than software UART. Just write a putc() function that sends a char to the UART and you don't need the assembly code.
  24. The pic you posted has resistors (Rprotect) ahead of the TVS. That is the source resistance I was referring to. Sorry that was not clear. Use the circuit in that pic.
  25. Easy fix may be a separate regulator for the target.
×
×
  • Create New...