This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ZCD with MSP430

Other Parts Discussed in Thread: MSP430F2013

 

Hello Forum,

I am designing a AC lamp dimmer with MSP430F2013, i am referring to Appnote "controlling Triac with MSP430", Zero Cross Detection  is made using 2 diodes and cap connected to a port pin, i have following doubts :

1) inside the External interrupt ISR can the trigger level be changed alternately like initially it will be high -to -low  trigger and next  trigger will happen on low-to-high level ?

2) i am using BT136-600 as triac in Quadrant 2&3 (gate low), does this scheme work with 3.3V VCC

3) can i parallel port pins to directly drive the Triac w/o using NPN transistor, is it safe for MSP430


Regards,

Nura

 

  • 1) external? What do you mean by that? You mean the port pin edge interrupt?  Well, yes, the port pin can be confiogured for interrupts on the raising or falling edge and you can change this setting whenever you want. Even inside the ISR that was triggered by the edge. Teh GPIO pins have schmitt-trigger characteristic, so there is only a low risk of getting a false trigger immediately after changing the trigger direction.

    Personally, I'd prefer a setup with a 1M resistor and a 2.7V or 3V Z-diode. This ensures a trigger of the level <0.5° after the zero point for the raising edge and ~0.5° before the zero point ont he falling edge of the same half wave. (for 230V, on 110V it is ~1°).
    I don't know the circuit in this appnote, but a series capacitor will usually generate positive and negative spikes instead of a limited level. So at a spike, you'll get a raising and immediately after a falling edge, which renders changing the trigger direction useless.

    2) Usually a triac requires a far higher voltage than 3.3V for triggering. Whether it is possible or not depends on the actual hardware design, where your digital ground is placed in relation to the triac and its gate, and teh intended application.

    3) See 2). It depends on where your 3.3V and the GND is in relation to the triacs electrical potential. Generally, you can parallel port pins for increased current (check the total port current for output voltage raise). But normally, the driving current of any MSP port should be high enough for driving a triac. The problem is, that even a 'high' voltage on the MSP port pins may be considered 'low' for the gate when the AC voltage level raises. For the NPN transistor, however, a 3.3V base voltage is definitely high while a 0V level on the base is low.

    So the NPN ensures that the circuit will work with any VC, as long as the IO ports generate an oputput voltage that is larger than his base-emitter voltage (~0.4V) and a few microamperes current at this voltage (depending on the triacs trigger current and the NPNs beta value.

  •  

    1) external? What do you mean by that? You mean the port pin edge interrupt?

    the word "External interrupt" is used more often in 8051 and AVR,  but in MSP430 - you call it "port pin edge interrupt "

     

    3) See 2). It depends on where your 3.3V and the GND is in relation to the triacs electrical potential. Generally, you can parallel port pins for increased current (check the total port current for output voltage raise). But normally, the driving current of any MSP port should be high enough for driving a triac. The problem is, that even a 'high' voltage on the MSP port pins may be considered 'low' for the gate when the AC voltage level raises. For the NPN transistor, however, a 3.3V base voltage is definitely high while a 0V level on the base is low.

    The MT1 of Triac is connected to phase / live / hot side of 230VAC and the VCC of the MCU is connected to MT1. one end of load is connected to MT2 of triac and other end of load to neutral of 230VAC.  The gate is triggered using negative pulse with a current limiting resistor connected to the collector of NPN(BC547). the base is connected via a resistor to the port pin of MCU. the powersupply for the circuit is derived using Capacitive reactance, the gnd of the mcu is connected to anode of the zener diode

    actually i have successfully implemented the above setup on 8052 and now i want to port the project to MSP430

     

    Regards,

    Nura


     

  • Nura said:
    the word "External interrupt" is used more often in 8051 and AVR,  but in MSP430 - you call it "port pin edge interrupt "

    Well, there is no official name for the interrupt. There is a PORT1 and a PORT2 interrupt vector (which serve all 8 interrupts from each of the respective port's 8 pins) and the interrupt flag bits for each pin have 'official' names, but ther eis non for the interrupt itself: it is usually referred to as 'port interrupt' in general, applying to both ports and all pins. The MSP has so many interrupts that can be caused by an external source, including but not limited to all the capture interrupt of the different timers, so use saying 'external interrupt' is too general to have a specific meaning.

    If you implemented the project successfully with an 8052, then the same setup should do for the MSP. But I understand that you want to remove the transistor if the MSP can drive enough current. Well...

    The BT136 series requires a gate trigger current of typical 5 to 30 mA (depending on quadrant) and max 35 to 70mA. 5mA are fine for the MSP, 30mA are way too much for a single port pin and 70mA is beyond the maximum current of a complete port (8 pins).How much the MSP can drive, depends on the actual MSP variant (check teh respective datasheet). The 5438 (which I'm using right now but whcih is certainly overkill for your project) allows up to 15 mA per port pin with full drive strength and a voltage drop of 0.6V.
    The 2013 datasheet doesn't list it that specific, but at 0.6V low voltage the port pins drive up tot 15mA too. Yet there is nothing about combined outputs (the diagrams are for one pin loaded at a t time) or maximum total currents.
    The maximum required gate trigger voltage of 1.5V indicates that it indeed may be possible to omit the NPN. But it somewhat depends on the device tolerances of MSP and triac. The transistor will reach the required current under any circumstances.

    The question that remains is what happens to the MSP if you switch phase and neutral supply? Or on voltage bursts/EMI/other distortions on the line. Could this fry the MSP? Here the transistor and the current-limiting resistor on its base acts as voltage divider and provides additional safety.

    Sorry, my office hours end soon and I'm too weary to draw a circuit based on your description and check it. And some work should be left to you on your project :)

     

    Anyway, did you know that there is a D-variant of the BT136 (e.g. BT136-600D) that has logic level gate input? Here the required currents are much lower: typical 2.0 to 5, max 5 to 10mA). Gate trigger voltage is still <1.5V

**Attention** This is a public forum