Jump to content

basil4j

Members
  • Content Count

    76
  • Joined

  • Last visited

  1. basil4j

    Combined PWM with interrupt not interrupting

    Hi Guys. Thought I'd responded but its not here! Yeah, I knew about the 2 vectors, CCR0 vector and the everything else vector. TAxCCR0 and TACTL interrupts are so similar in reality that I thought they were the same lol all clear now thanks! Sent from my SM-G900F using Tapatalk
  2. basil4j

    Combined PWM with interrupt not interrupting

    Oh right, so I dont need to enable TAIE on both TA0CCTL0 (the one I want) and TA0CTL, just on TA0CCTL0? I am not using TA0CCTL1 interrupts.
  3. basil4j

    Combined PWM with interrupt not interrupting

    Gah, that bit is on a new line, silly forum forumatting
  4. basil4j

    Combined PWM with interrupt not interrupting

    Oh, yes I did. All other interrupts work.
  5. Hi All, I am trying to generate a PWM output using TimerA, which I also want to trigger an interrupt at TACCR0. There is nothing in the manual that suggests I cant do this, but for some reason the interrupt is not firing, even though PWM is working as expected. Here is how I set it up, can anyone spot anything obvious? #define PWMOUT BIT2; P1OUT &= ~PWMOUT; // output 0 to start with P1DIR |= PWMOUT; // set as output P1SEL |= PWMOUT; // select timer OUT TA0CCR0 = PWM_FREQ_CLKS - 1; TA0CCR1 = PWM_DUTY_CLKS; TA0CCTL1 |= OUTMOD_7; // setup pwm output mode TA0CCTL0 |= CCIE; // enable interrupt TA0CTL |= (TASSEL_2 + MC_1 + TAIE); // start timer, enable interrupts and the ISR #pragma vector=TIMER0_A0_VECTOR //Timer A0 CCR0. __interrupt void PWM_Cycle(void) { TA0CCR1 = PWM_DUTY_CLKS; Measured_COMM_PWM_Counts++; }
  6. basil4j

    4-20mA signal to MSP430 questions....

    Maybe i'm misreading, but I thought the MSP430 analog input range was 0 - Vcc not 0 - 2.5V? ADC10CTL0, SREFx = 000 sets Vref+ to Vcc, and VRef- to Vss
  7. basil4j

    MSP430G2553 Pullups

    Ok I've been doing some thinking/testing and I think the internal pullups will work. A question remains however. What effect will the voltage divider which precedes the pullup have? I'm trying to nut it out, and all I can conclude is that the low resistance resistor in the VDiv which is attached to ground will fight with the high resistance pull up, the result being the input is pulled low.
  8. basil4j

    MSP430G2553 Pullups

    Hi All, Been a while since ive posted, but have picked up a little BLDC project again. I have designed a PCB for this BLDC controller im making, but have put pull-down resistors on the hall sensor inputs instead of pull-ups, which are what I need for the particular motors I want to drive. Stupid mistake. The manufacturers own BLDC controller uses 20k pull ups on their controllers, and I note the MSP430G2553's internal pull ups are 35k (20k-50k). If i were to just leave off the pull-downs on my PCB and use the internal pull ups, are they generally good enough to do the job? Ive never used the MSP internal pull-ups/downs before so dont know what to expect. This would save getting some new boards made, ill fix it with the next revision. EDIT: Maybe an important bit of info. The hall sensors are 5V, so I have a voltage divider dropping the level to 3.3V. This is jointly acting as the pulldown. (5v through 270R to MSP430, pulled to ground via 470R). Thanks! Alec
  9. basil4j

    Current sense layout

    Ahh I see, thanks oPossum. On a side note, possums in the USA look much cuter than possums in my country, where we shoot them for ruining everything haha
  10. basil4j

    Current sense layout

    Ok ill try to outline my application a bit more. My customer is building a piece of machinery for a fertlizer truck which requires 4 BLDC motors to spin an attachment (one device per motor). I cant go in to too many details as i'm under NDA's and patents are pending etc etc, but from the motors point of view the attachments are effectively flywheels. The role of my controller is simple. There will be 1 per motor. When power is applied (24VDC from trucks batteries), ramp the motors to 500RPM in 2 seconds and stay there. When power is removed, motors can coast to a stop. That is all. The motor and controller will be housed together in a sealed stainless steel enclosure, with a gland for the power cable to enter. The power come from the battery via a relay and fuse. There are no other external connections. Nearby there will be some 0-10V operated proportional valves but these are on a separate power and control circuit. I have been asked to focus on reliability, so will add over current (hence the current sense) and over temperature protection. The motors are maxon EC Flat 90W which are 48V motors, 2.27A nominal current. The rest of the specs are on the referenced link. At 44RPM/V I will be operating these on 24V at ~47% duty cycle @ 20kHz to give me 500RPM. I could operate them on 12V at ~97% duty but I want the option to operate at max ~1000RPM is customer changes his design and 12V wont allow me to do this. I will be driving the motor using DMN4020LFDE FET's (rated to 8A continuous, 32A pulsed) which will be driven by a FAN7888 with a 12V gate output voltage. the design is largely based off the work by lgbeno which he has open sourced but with a few alterations to suit my application. Here is the schematic so far. The work in progress is the TVS in the top right. I have chosen the SMA6J24A-TPMSCT Im having trouble posting replies with images embedded, so please excuse me for this link... https://docs.google.com/uc?export=download&id=0B1BqLgL5jaHXZmMyUnpyM3FMZ1k
  11. basil4j

    Current sense layout

    Thanks for all that! I'll put together a summary of the application when I'm not on my phone and post a schematic. Sent from my GT-I9300 using Tapatalk
  12. basil4j

    Current sense layout

    Thanks, so if I simply add a low value resistor before the TVS I should be ok? I figure this will protect the current sense IC also so I wouldn't need anything like in the current sense datasheet I linked a snippet of? Would this be the correct thinking?
  13. basil4j

    Current sense layout

    Very weird, im having serious issues trying to reply. Whenever I reply with an embedded image, the post dissapears?... Hi Zeke, Not yet, alas the opportunity for prototyping is rare with this project. This is being retro fitted to a fertilizer truck down the other end of the country, which I don't have access to. I have played around a bit with the layout and the traces are now only 10mm long and surrounded by nice ground pours so it shouldnt be a problem. My next question is about TVS diodes I had planned on simply putting a TVS diode across the battery input terminals, before the sense resistor. But then I found this in the current sense datasheet and im wondering if I need to change things or will my current scheme work just as well? https://docs.google.com/uc?export=download&id=0B1BqLgL5jaHXWW12X1JoODVhWXM
  14. basil4j

    Current sense layout

    Hah all good For what its worth, I have a ground pour on all layers and have tried to space susceptible traces out enough that the ground pour surrounds them. 0.1uf decoupling on all power pins on all IC's, a couple of larger ones on the various LDO's. All diodes and caps on the battery or 12V power supplies are rated to 50V, all on 3.3v are rated to 16V. I have put an TVS across the battery input terminals. Don't know much about them but I think I got it right The controller will be connected to the motor by about 5cm of cable, both inside the same sealed enclosure. The only external connection to this controller is the battery and motor, therefore the battery input is the only one I would think need protection?, hence the TVS. Hope I'm taking enough precautions
  15. basil4j

    Current sense layout

    Hi All, With the help if lgbeno I am laying out an MSP430 based BLDC controller. I wish to add over current protection by taking the output from an INA199 current sense ic into a comparator input on the MSP430. Due to space restraints and general layout niceness I have the MCU diagonally opposite the power input, beside which I have located the shunt resistor. The board is small, 45mm x 35mm so this may be an irrelevant question. My question is: Is it best to locate the sense ic near the MCU, thus reducing the length of the Vout trace but increasing the length of the Vin + and - traces (they would run parallel to each other). Or is it best to locate the sense ic near the shunt and have a longer Vout trace? This is a 4 layer board, gnd-gnd-power-gnd planes. The top side has the high freq traces (20khz pwm and hall inputs). The current sense traces are on the bottom. This is an automotive application so I am trying to make it as immune to electrical noise as possible. Would a small amount of noise even matter for over current protection? I would have safety margins built in. Thanks for the input! Regards, Alec Sent from my GT-I9300 using Tapatalk
×