Jump to content

rampadc

Members
  • Content Count

    141
  • Joined

  • Last visited

  • Days Won

    2

rampadc last won the day on June 22 2014

rampadc had the most liked content!

About rampadc

  • Rank
    Level 1

Contact Methods

  • Website URL
    http://flashandrc.wordpress.com/

Profile Information

  • Gender
    Not Telling
  • Location
    Australia
  1. rampadc

    Unable to identify motor (Error -1135)

    I spoke too soon. Lab 2c solved the problem.
  2. Hey guys, I'm doing Lab 2b in the MotorWare package with the Launchpad F2807 and BoosterPack 8301 with a Hobbyking 12V, max 60A motor at the moment and the program keeps stopping at EST_State_Ls (already passed through 2 other stages) which I then get soon after: C28xx: Error: (Error -1135 @ 0x3F27A5) The debug probe reported an error. Confirm debug probe configuration and connections, reset the debug probe, and retry the operation. (Emulation package 6.0.14.5) C28xx: Unable to determine target status after 20 attempts C28xx: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging At first, I thought the error was due to the power cable unable to deliver more than 5A rated current, but after changing it to a 10A cable, the problem still persists. The lab works fine with a lower power motor, though the motor got excessively hot and shaky during lab run. Thanks for the help.
  3. rampadc

    ISR Trap

    Problem is duct-tape fixed, I triggered a software power-on-reset in a group of unused interrupts.
  4. rampadc

    ISR Trap

    I'm running into a nasty problem and can't crawl my way out of it. While, I am fairly certain I have included interrupt service routines for all of the interrupts that I am using, the microcontroller still gets trapped under some mysterious interrupt: The trap triggers randomly, sometimes after a few minutes of running, sometimes several hours afterwards. I'm using CC430F5137 chip and below my isr.c handling the interrupts. #include <stdint.h> #include <stdio.h> #include <msp430.h> #include <cc430x513x.h> #include "RF1A.h" #include "hal.h" #include "buffers.h" #include "phy.h" #ifdef _LL_ #include "ll.h" #endif /* whether to stay in the isr */ static uint8_t stayInISR = 0; /************************************************************************************* * External variables *************************************************************************************/ extern volatile uint8_t packetReceived; //phy.c extern volatile uint8_t packetTransmit; extern uint8_t buttonPressed; //hal.c extern uint8_t enableUartLog; //hal.c uint8_t lqi; /************************************************************************************* * MSP430 Core Interrupts *************************************************************************************/ #ifdef _LL_ /* _LL_ is predefined. This section is getting compiled */ /* Link Layer's timer */ #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_A0_ISR(void) { /* some magic */ } #endif #pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR(void) { switch(__even_in_range(P1IV, 16)) { case 0: break; case 2: break; // P1.0 IFG case 4: // P1.1 IFG P1IFG &= ~BIT1; __delay_cycles(24000); // 2ms debounce delay //button is active low if((P1IN & BIT1) == 0x00) { buttonPressed = 1; } __bic_SR_register_on_exit(LPM3_bits); //Exit active break; case 6: break; // P1.2 IFG case 8: break; // P1.3 IFG case 10: break; // P1.4 IFG case 12: break; // P1.5 IFG case 14: break; // P1.6 IFG case 16: // P1.7 IFG break; } } #pragma vector=USCI_A0_VECTOR __interrupt void USCI_A0_ISR(void) { switch(__even_in_range(UCA0IV,4)) { case 0:break; // Vector 0 - no interrupt case 2: // Vector 2 - RXIFG while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready? UCA0TXBUF = UCA0RXBUF; // TX -> RXed character break; case 4:break; // Vector 4 - TXIFG default: break; } } /* Application timer */ #pragma vector=TIMER1_A0_VECTOR __interrupt void Timer1_ISR(void) { sendNow = 1; __bic_SR_register_on_exit(LPM3_bits); } /************************************************************************************* * MSP430 Core Unused interrupts *************************************************************************************/ #pragma vector=RTC_VECTOR #pragma vector=PORT2_VECTOR #pragma vector=AES_VECTOR #pragma vector=DMA_VECTOR #pragma vector=ADC12_VECTOR #pragma vector=USCI_B0_VECTOR #pragma vector=COMP_B_VECTOR __interrupt void Unused_Interrupt_ISR(void) { /* Real-time clock interrupts */ RTCCTL0 &= ~(RTCRDYIE + RTCAIE); /* Port 2 interrupt */ P2IE = 0; /* AES interrupt */ AESACTL0 &= ~AESRDYIE; /* DMA interrupt */ DMA0CTL &= ~DMAIE; DMA1CTL &= ~DMAIE; DMA2CTL &= ~DMAIE; /* ADC */ ADC12IE = 0; /* USCI_B */ UCB0IE = 0; /* Comparator B */ CBINT = 0; while(stayInISR); __bic_SR_register_on_exit(LPM3); } /************************************************************************************* * RF Core Interrupts *************************************************************************************/ // Called if an interface error has occured. No interface errors should // exist in application code, so this is intended to be used for debugging // or to catch errant operating conditions. static void RF1A_interface_error_handler(void) { switch(__even_in_range(RF1AIFERRV,8)) { case 0: break; // No error case 2: // Low core voltage error P1OUT &= ~BIT0; // 00 = on LED's [D2,D1] P3OUT &= ~BIT6; __no_operation(); break; case 4: // Operand Error P1OUT |= BIT0; // 01 = on LED's [D2,D1] P3OUT &= ~BIT6; __no_operation(); break; case 6: // Output data not available error P1OUT &= ~BIT0; // 10 = on LED's [D2,D1] P3OUT |= BIT6; __no_operation(); break; case 8: // Operand overwrite error P1OUT |= BIT0; // 11 = on LED's [D2,D1] P3OUT |= BIT6; __no_operation(); break; } } // If RF1A_interrupt_handler is called, an interface interrupt has occured. static void RF1A_interrupt_handler(void) { // RF1A interrupt is pending switch(__even_in_range(RF1AIFIV,14)) { case 0: break; // No interrupt pending case 2: // RFERRIFG RF1A_interface_error_handler(); case 4: break; // RFDOUTIFG case 6: break; // RFSTATIFG case 8: break; // RFDINIFG case 10: break; // RFINSTRIFG case 12: break; // RFRXIFG case 14: break; // RFTXIFG } } #pragma vector=CC1101_VECTOR __interrupt void CC1101_ISR(void) { switch(__even_in_range(RF1AIV,32)) // Prioritizing Radio Core Interrupts { case 0: // No RF core interrupt pending RF1A_interrupt_handler(); // means RF1A interface interrupt pending break; case 2: break; // RFIFG0 case 4: break; // RFIFG1 case 6: break; // RFIFG2 case 8: break; // RFIFG3 case 10: // RFIFG4 - RX end-of-packet packetReceived = 1; break; case 12: break; // RFIFG5 case 14: break; // RFIFG6 case 16: break; // RFIFG7 case 18: break; // RFIFG8 case 20: // RFIFG9 - TX end-of-packet packetTransmit = 1; break; case 22: break; // RFIFG10 case 24: break; // RFIFG11 case 26: break; // RFIFG12 case 28: break; // RFIFG13 case 30: break; // RFIFG14 case 32: break; // RFIFG15 } __bic_SR_register_on_exit(LPM3_bits); } After the trap, the application just stops working, all the timers interrupt like Timer1_A0 ISR stops getting called altogether and the application layer halts. Am I missing any interrupts? How should I rewrite this file to make it look better/more organized? Thanks for your help.
  5. rampadc

    Concurrently debugging multiple boards

    Pretty sad I'd suppose. I'm gonna go with jazz's suggestion with upping the UART baud rate and see how that fares. EDIT: Hey @@jazz, what do you mean by mailbox?
  6. rampadc

    Concurrently debugging multiple boards

    The boards are Olimex's MSP430-CCRF (CC430F5137) and I'm using MSP430F5529LP as programmers and debuggers. I have to use CCS and I'm really hopping to not having to resort to using 2 workspaces, not sure if that would work but really wishing that it wouldn't come to that.
  7. There was a question posted in the forums with this question about 2 years ago but the given answer didn't answer the question so I'm gonna post it again. Is there a way to make CCS debug 2 boards at the same time or have another tool that will debug 2 boards at a time? I'm doing a RF system and I'd like to look at the expressions at breakpoints (Refresh mode) for both boards while they're RX-ing and TX-ing. UART with printf is rather useless as it introduces time delay and can cause the RX side to miss out packets.
  8. rampadc

    Code Composer Studio C Dialect

    Thanks for the replies guys.
  9. I wrote some code for ring buffers and I thought of testing it with a MingW with Eclipse on the PC first so I can make sure all functions are working correctly before loading it onto the MCU. Plus, compiling and debugging are faster on the PC compared to loading it onto MSP430. Except I'm getting all these warnings complaining about integer overflows (comparing 8-bit definitions and assigning values to uint8_t) and integer casting pointer problems that I don't get in CCS. These warnings doesn't seem to be serious but when I compiled and run the program, the return values of the functions are all wrong - definition assignments to uint8_t typed variables seems to fail, all of them. The project I'm working on is more software-based than hardware. I've got another guy working purely on another layer which is entirely software-based, though he does call functions from my part. Eventually, our code will be merged. I'm not sure if it's gonna be a problem since he doesn't use CCS for writing C code. For my own testing, it'd be great if you guys can help me with: - Which dialect of C does CCS use? (TI 4.4.4 is my compiler version just in case it's necessary) - How to set up another compiler to be able to compile like the TI compiler? - Can I use CCS's TI compiler to do general purpose C coding for code verification - like a simulator maybe? I'm out of my depth when it comes to compilers so I may have used all the wrong terminology when describing the problem. Cheers.
  10. rampadc

    CC430's clear channel assessment

    Hey guys, anyone uses CC430? I need some help with a using CC430's Clear Channel Assessment feature, particularly with these 2 questions I posted on TI's e2e forums: https://e2e.ti.com/support/wireless_connectivity/f/156/t/438635 https://e2e.ti.com/support/wireless_connectivity/f/156/t/438666 Basically I only get the CCA interrupt signal asserted once and after that, it always fail. A reset lets the CCA signal asserts again. I've been wrecking my brain for the last week and couldn't come up with a solution. An answer here or the TI forum would be great. Thank you. EDIT: Problem resolved.
  11. rampadc

    Button interrupt not working in CC430 with RF

    Found a misbehaving while loop in phy_transmit(). Thanks for the help guys.
  12. Hi, I'm getting a weird problem with a button interrupt while using the RF1A module on a CC430F5137 chip, where the code inside the main loop only works 1 time and never again even though the ISR is being executing and flag (buttonPressed) are being set correctly. I can't find what's wrong and can't proceed to fix the problem. Main.c extern uint8_t buttonPressed; uint8_t main(void) { WDTCTL = (uint16_t)(WDTPW | WDTHOLD); /* Stop watch dog timer */ __disable_interrupt(); //ACLK = REFO 32768 Hz //MCLK = SMCLK = 12 MHz //UART 38400 hal_init430(); hal_initTimers(); //2Hz timer for alive-LED uint8_t i; for(i = 0; i < 4; i++) printf("Syncing UART\r\n\r\n"); //prep realTerm to display ascii characters printf("Initializing RF core\r\n"); phy_reset(); //set voltage levels, write rf registers, etc. phy_enableRX(); //go into RX mode printf("RF Core initialized\r\n"); //main while loop while(1) { if(buttonPressed) { __no_operation(); //for debugging buttonPressed = 0; printf("\r\nButton pressed! main-while-loop\r\n"); phy_transmit((uint8_t*)TxBuffer, sizeof TxBuffer); } __bis_SR_register(LPM3_bits + GIE); } return 0; } isr.c extern uint8_t buttonPressed; //hal.c /************************************************************************************* * MSP430 Core Interrupts *************************************************************************************/ #pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR(void) { switch(__even_in_range(P1IV, 16)) { case 0: break; case 2: break; // P1.0 IFG case 4: // P1.1 IFG P1IFG &= ~BIT1; __delay_cycles(24000); // 2ms debounce delay //button is active low if((P1IN & BIT1) == 0x00) { //button is pressed down, transmit "Hello World" printf("\r\nButton is pressed Line 39 isr.c\r\n"); buttonPressed = 1; } __bic_SR_register_on_exit(LPM3_bits); //Exit active break; case 6: break; // P1.2 IFG case 8: break; // P1.3 IFG case 10: break; // P1.4 IFG case 12: break; // P1.5 IFG case 14: break; // P1.6 IFG case 16: // P1.7 IFG break; } } UART log for RF project
  13. Try swapping TX and RX so that your 430's TX - USB's RX.
  14. rampadc

    Autocomplete option in IAR workbench

    If you have existing structures (struct {}), then IAR would detect them. Other than that, its code completion or assistant is non-existent.
  15. How about a physical spring-switch like the ones used on fridges doors? If the switch is closed, gate is closed. For the occasional meddling neighbour kids, maybe have 2 switches just to be sure. These would solve both problems. I'm thinking of 'gates' along the line of garage doors and alike. I'm not sure what's meant by gate opener so this may not be the answer you're looking for.
×