Jump to content

GeorgeIoak

Members
  • Content Count

    31
  • Joined

  • Last visited

About GeorgeIoak

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  1. GeorgeIoak

    MSP430F550x based frequency meter

    This is one of those times when I hate that TI has so many different MSP430 devices to choose from! Looking back I see now that there are only 6 devices which have this special Timer D (MSP430F51x1, MSP430F51x2) and looking at that families datasheet I see on page 43 that the "Local Clock Generator Frequency", fHRCG, goes all the way up to 1074MHz (826MHZ typical) and the "Trimmed Clock Frequencies", fTRIM, is the 256MHz that I guess I read about. Right on page 45 is the "Input Capture and Output Compare Timing" specs and it shows tTD, (Timer_D input capture timing, minimum pulse duration to trigger input capture event) is 4ns typical. So now I'm really curious what can really be done with one of these parts if you were able to count 48MHz with a "standard" MSP430. Looks like @@RobG 's board hasn't been in stock for awhile but I found another one to add to my pile. Of all people SchmartBoard made one
  2. GeorgeIoak

    MSP430F550x based frequency meter

    Well if nothing else I'm going to have a few boards to play with in the next few days. I somehow missed that there was a LaunchPad board for this series so I just ordered one of those. Before that I found a low cost board from Olimex that looked interesting. As if that wasn't enough I also picked up one of the C2000 LaunchPad boards since those 200MHz parts should be able to sample fast enough for me. In my application I'm going to be actually counting pulses as the signal isn't going to be a nice fixed frequency. It may turn out that I might not have to catch every pulse so we'll see once I get my hands on everything and do some sampling. Thanks for your inputs!
  3. GeorgeIoak

    MSP430F550x based frequency meter

    Looks like I'll have to design my own board or order @@spirilis PCBs because I didn't see stock on his board. I also found another open source design, http://www.rev0proto.com/wiki/index.php/MSP430F5510 that I might take a look at. I'm curious about your comment on it not going higher than 48MHz. I thought the whole purpose of Timer D was to go up to 256MHz on the output.
  4. GeorgeIoak

    MSP430F550x based frequency meter

    I was looking at doing some further testing on this. Out of curiosity what board did you use which had the MSP430F550x? I also wonder if we used a 2nd MSP430F550x to generate the input frequency we could test higher than 48MHz? I ordered some samples of the MSP430F5172IDAR but I couldn't find any low cost eval boards, only this, http://www.ti.com/tool/msp-fet430u40
  5. GeorgeIoak

    TI's MSP432 WDT Example code Error

    While debugging my code this weekend I decided to step back and try to debug certain aspects of it. TI's Resource Explorer is a great tool with plenty of example code to look at and review. I was having issues with my WDT routine so I thought I would double check running one of the examples that was released, to be specific, I was interest in the WDT_02 example which can be seen here. The code was not working which really left me wondering since I assumed that any code published BY TI as an example MUST have been checked to see if it actually worked?! Well as it turns out the code does NOT work and has an error in it (actually more than 1). I posted over on TI's e2e forums and for a little detail you can look at that post here. For those that just want to know what is wrong, this line of code: WDTCTL = WDTIS_4; // WDT 250ms, ACLK, interval timer Needs to be modified to: WDTCTL = WDTIS_5 | WDTTMSEL | WDTSSEL_1 | WDTCNTCL | WDTPW; // WDT 250ms, ACLK, interval timer Hopefully the next person left scratching their head wondering what's wrong will find this post and not have to waste time trying to figure out what is going on.
  6. GeorgeIoak

    MSP432 Debugging and Interrupt Oddities

    I worked on this over the weekend but didn't make much progress. I updated the code as I made some minor cleanup changes so there's a new commit on GitHub. I added a statement in the WDT ISR to toggle the LED (P1.0, red LED on LaunchPad). Running the code in the debugger does not toggle the LED yet if I pause execution, step through some lines, and then start the code again the LED changes but only once. The Port1 ISR does not appear to be working either so it seems like there's a problem with how my ISR's are being handled. Unfortunately I'm left still scratching my head though...
  7. GeorgeIoak

    MSP432 Debugging and Interrupt Oddities

    OK, ignore my comment about the ADC14MEM0 not getting updated. It helps if you turn on your power supply and apply a voltage to the ADC pin before you take a measurement! I looked at the original project's code and noticed they have the variable defined as static but if what you're saying is true it should have been defined as volatile. Unfortunately for me neither definition changes the operation of the code. What is very consistent is that if I pause the code and see that diode_sensor_read_result = 1 if I step through the code in single steps the code seems to work as expected and values are placed in the samples array. IF I pause and see that diode_sensor_read_result = 1 and instead just start the code running again the values do not get placed in the samples array. What I also find is that if I pause the program and diode_sensor_read_result = 0 and then single step I never see this variable get set to 1 which means the ADC14Isr is never triggered but diode_sensor_read function is run which starts the conversion: void diode_sensor_read(void) { diode_sensor_result_ready = 0; ADC14CTL0 |= ADC14ENC | ADC14SC; // Start sampling/conversion } I know I'm not very good at this but this type of problem is really making me scratch my head, especially on how to try to debug it!
  8. GeorgeIoak

    MSP432 Debugging and Interrupt Oddities

    Thanks for looking at this. Unfortunately that change appears to make things worse. Now if I pause the code and step through it when diode_sensor_result_ready = 1 the function diode_sensor_read_result is executed but the ADC14MEM0 contents are not placed into the samples array like they were before this change. Actually I just removed the volatile and I'm getting the same results so I must have made a bad change last night before I stopped working. It's a bit odd though since I can step through and see the code execute but the debugger watch variables don't update. I should also mention that several times when I run the debugger and look in the expressions window the watched registers that I placed there seem to disappear. The rows are still there but they are blank. This has been happening the past few days and I'm not sure if it's related just to my code or something with CCS. If the CCS expressions window seems odd to you I'll make a post over on e2e and see what TI has to say about it. For now I'll add your volatile and keep looking for what I've done.
  9. I found this old project for a MSP430 and was trying to modify it for my project as well as getting it work with the MSP432 LaunchPad. The code seems to work but only if when in the debugger I start and pause the code. In the ADC14ISRHandler routine I set this variable: diode_sensor_result_ready = 1; If I run the code this variable is always 0 but if I pause the code it seems like that enables the ISR to run, set the variable to1 and then the code proceeds. I uploaded the project to Github if someone has the time to look through it, https://github.com/GeorgeIoak/Cheese The reference project is from here, http://forum.43oh.com/topic/1069-msp430-based-digital-thermometer I was following some of the other TI examples on setting and using the WDT but I'll admit that I don't have my head wrapped around all this yet!
  10. GeorgeIoak

    "#112-D statement is unreachable" warning

    I figured out that the compiler warnings are happening because once you enter the while(1) loop you'll be stuck in it and can never reach the statements outside of the loop. The other "error" I received this response over on the TI e2e forums:
  11. GeorgeIoak

    "#112-D statement is unreachable" warning

    Unfortunately it is already set to OFF but it was a good thought
  12. I'm running a fully updated CCS 6.1.2.00015 and a MSP432 project. I'm far from a good programmer and am modifying an old MSP430 project I found here for my project. I get this warning during compile and then while debugging the code seems to get stuck and throws a "error: cannot load from non-primitive location". I'm not sure if they're related but I can't seem to find any help for either of them. I've attached the project files. If anyone has any helpful advice on how to solve these I would greatly appreciate the help! Thanks, George MyADC14_v2.cPhotoDiode_Sensor.cPhotoDiode_Sensor.h
  13. GeorgeIoak

    Graphics Library for MSP432

    Does anyone have any interest in expanding this library to include loading images stored on SD cards like what Adafruit does? Their code for Arduino is located at https://github.com/adafruit/Adafruit_ILI9340/blob/master/examples/spitftbitmap/spitftbitmap.ino
  14. GeorgeIoak

    Can TimerA ISR Stop Itself?

    I didn't get an email notice that you had posted to this so I apologize for the late response. I have my variables defined like this: #include "msp430g2131.h" #define S1 0x0001 #define TRIGGER 120 // Will allow ~10msec timing #define PH BIT2 //DRV8838 PH pin, 0:Forward, 1:Reverse, connected to P1.2 #define EN BIT6; //DRV8838 EN pin, 1 for FWD/REV, 0 sets both outputs low, P2.6 #define SLP BIT7; //DRV8838 Sleep pin, 0 for sleep, high Z outputs, P2.7 unsigned int PressCount = 0; unsigned int Pressed = 0; unsigned int PressRelease = 0; unsigned int i = 0; The only place PressRelease is modified is in the Port1 and WDT ISRs and I see it initially set to 0. I have not been able to determine exactly what is wrong but on the scope I do sometimes see a long press followed by a short press. The code also seems to miss some button presses that I can see on the scope.. I can't seem to find the pattern but I'm sure it's there. I'll change the PressRelease and see if that changes the results
  15. GeorgeIoak

    MSP430G2231 I2C Slave

    Thanks for clarifying the port pins and catching the difference between USCI and USI. I am clearing flags but I'm just not seeing the ISR get triggered again after the initial interrupt. Perhaps you can see something I'm doing wrong that I haven't caught yet. My USI is configured like this: USICTL0 = USIPE6+USIPE7+USISWRST; // Port & USI mode setup USICTL1 = USII2C+USIIE+USISTTIE; // Enable I2C mode & USI interrupts USICKCTL = USICKPL; // Setup clock polarity USICNT |= USIIFGCC; // Disable automatic clear control USICTL0 &= ~USISWRST; // Enable USI USICTL1 &= ~USIIFG; // Clear pending flag and then my ISR starts with this: #pragma vector = USI_VECTOR __interrupt void receive_data() { if (USICTL1 & USISTTIFG) // Start entry? { P1OUT |= 0x01; // LED on: Sequence start I2C_State = 2; // Enter 1st state on start } switch(I2C_State) { case 0: //Idle, should not get here break; case 2: //RX Address USICNT = (USICNT & 0xE0) + 0x08; // Bit counter = 8, RX Address USICTL1 &= ~USISTTIFG; // Clear start flag I2C_State = 4; // Go to next state: check address break; case 4: // Process Address and send (N)Acknowledge if ((USISRL & 0x01) == 1) { // If read... I2C_CONTROL |= I2C_READ; // Save R/W bit USISRL &= ~0x01; } USICTL0 |= USIOE; // SDA = output if (USISRL == (SLV_Addr << 1)) // Address match? { USISRL = 0x00; // Send Acknowledge P1OUT &= ~0x01; // LED off if (I2C_CONTROL & I2C_READ) { I2C_State = 5; // Go to next state: TX Data } else { I2C_State = 8; // Go to next state: RX data } } else { USISRL = 0xFF; // Send NAck P1OUT |= 0x01; // LED on: error I2C_State = 6; // Go to next state: prepare for next Start } USICNT |= 0x01; // Bit counter = 1, send (N)Acknowledge bit break; I see the ISR get triggered when I have the Bus Pirate connected and probing. I2C_State gets set to 2 and then it enters the switch section, processes case 2 but then the ISR is never triggered again. I can pause the debugger and verify that I2C_State is 4 but it never goes back into the ISR. I'm sure I'm just missing something so perhaps someone can catch where I went wrong. When I first tried to compile my code I ran out of room so I had to eliminate some parts just so I could get my code to fit into the 2231. I just thought I'd mention that in case there are some known problems when the memory is almost/completely full?
×