Jump to content
43oh

maelli01

Members
  • Content Count

    48
  • Joined

  • Last visited

  • Days Won

    16

Reputation Activity

  1. Like
    maelli01 got a reaction from roadrunner84 in Tiny low power LED clock   
    Hello,

    Oh no, not another clock...

    My first standalone MSP430 project and also my first project to
    be programmed "in circuit", and a soldering exercise for the TSSOP housing

    A tiny LED clock. It is minimalistic by all means:
    -a TSSOP G2452, no other IC
    -only one button to set the time
    -a dumb 4 digit white LED 7 segment display, https://www.sparkfun.com/products/11409
    -a PCB size of 25mm x 25mm
    -extremely low power

    Wanted to find out whether I can use the TSSOP with my usual home made setup,
    that is Eagle, Deskjet printer, photosensitive base material, UV-lamp, develop,
    the ugly FeCl3 etching, and then hand-solder.
    The PCB is single sided of course.

    I use the lauchpad for programming.

    The white LEDs of the display are pretty bright at their nominal current.
    I wanted something low power and just enough brightness to see the time in the
    middle of the night with darkness-adapted eyes.
    So at 4:30 in the morning, the display is much more useful than an LCD.

    The whole thing draws around 0.3- 0.5mA, LEDs included.
    CPU runs at 1Mhz, but is in LPM3 most of the time, even though the poor thing has
    a restless sleep: it has to wake up 512 times a second, to do the multiplexing.

    At this low current there are quite a few options for a power supply, I considered

    - 2 AA cells; would run around half a year
    - something solar, with supercap
    - I ended up with direct AC supply via a capacitive dropper, 4700pF mains rated film
    cap. Where I live, plugs are polarized, so I know which one if life and which one
    is neutral. Still I think that this would not be street-legal without double insulation
    housing.

    Overall I calculated 2milliwatt total power consumption, probably the lowest of
    any mains powered clock.

    If anybody is interested, I might bring schematic and software into
    human-readable form.
     


  2. Like
    maelli01 got a reaction from RobG in Tiny low power LED clock   
    Hello,

    Oh no, not another clock...

    My first standalone MSP430 project and also my first project to
    be programmed "in circuit", and a soldering exercise for the TSSOP housing

    A tiny LED clock. It is minimalistic by all means:
    -a TSSOP G2452, no other IC
    -only one button to set the time
    -a dumb 4 digit white LED 7 segment display, https://www.sparkfun.com/products/11409
    -a PCB size of 25mm x 25mm
    -extremely low power

    Wanted to find out whether I can use the TSSOP with my usual home made setup,
    that is Eagle, Deskjet printer, photosensitive base material, UV-lamp, develop,
    the ugly FeCl3 etching, and then hand-solder.
    The PCB is single sided of course.

    I use the lauchpad for programming.

    The white LEDs of the display are pretty bright at their nominal current.
    I wanted something low power and just enough brightness to see the time in the
    middle of the night with darkness-adapted eyes.
    So at 4:30 in the morning, the display is much more useful than an LCD.

    The whole thing draws around 0.3- 0.5mA, LEDs included.
    CPU runs at 1Mhz, but is in LPM3 most of the time, even though the poor thing has
    a restless sleep: it has to wake up 512 times a second, to do the multiplexing.

    At this low current there are quite a few options for a power supply, I considered

    - 2 AA cells; would run around half a year
    - something solar, with supercap
    - I ended up with direct AC supply via a capacitive dropper, 4700pF mains rated film
    cap. Where I live, plugs are polarized, so I know which one if life and which one
    is neutral. Still I think that this would not be street-legal without double insulation
    housing.

    Overall I calculated 2milliwatt total power consumption, probably the lowest of
    any mains powered clock.

    If anybody is interested, I might bring schematic and software into
    human-readable form.
     


  3. Like
    maelli01 got a reaction from manhdan in Tiny low power LED clock   
    Hello,

    Oh no, not another clock...

    My first standalone MSP430 project and also my first project to
    be programmed "in circuit", and a soldering exercise for the TSSOP housing

    A tiny LED clock. It is minimalistic by all means:
    -a TSSOP G2452, no other IC
    -only one button to set the time
    -a dumb 4 digit white LED 7 segment display, https://www.sparkfun.com/products/11409
    -a PCB size of 25mm x 25mm
    -extremely low power

    Wanted to find out whether I can use the TSSOP with my usual home made setup,
    that is Eagle, Deskjet printer, photosensitive base material, UV-lamp, develop,
    the ugly FeCl3 etching, and then hand-solder.
    The PCB is single sided of course.

    I use the lauchpad for programming.

    The white LEDs of the display are pretty bright at their nominal current.
    I wanted something low power and just enough brightness to see the time in the
    middle of the night with darkness-adapted eyes.
    So at 4:30 in the morning, the display is much more useful than an LCD.

    The whole thing draws around 0.3- 0.5mA, LEDs included.
    CPU runs at 1Mhz, but is in LPM3 most of the time, even though the poor thing has
    a restless sleep: it has to wake up 512 times a second, to do the multiplexing.

    At this low current there are quite a few options for a power supply, I considered

    - 2 AA cells; would run around half a year
    - something solar, with supercap
    - I ended up with direct AC supply via a capacitive dropper, 4700pF mains rated film
    cap. Where I live, plugs are polarized, so I know which one if life and which one
    is neutral. Still I think that this would not be street-legal without double insulation
    housing.

    Overall I calculated 2milliwatt total power consumption, probably the lowest of
    any mains powered clock.

    If anybody is interested, I might bring schematic and software into
    human-readable form.
     


  4. Like
    maelli01 got a reaction from greeeg in Tiny low power LED clock   
    Hello,

    Oh no, not another clock...

    My first standalone MSP430 project and also my first project to
    be programmed "in circuit", and a soldering exercise for the TSSOP housing

    A tiny LED clock. It is minimalistic by all means:
    -a TSSOP G2452, no other IC
    -only one button to set the time
    -a dumb 4 digit white LED 7 segment display, https://www.sparkfun.com/products/11409
    -a PCB size of 25mm x 25mm
    -extremely low power

    Wanted to find out whether I can use the TSSOP with my usual home made setup,
    that is Eagle, Deskjet printer, photosensitive base material, UV-lamp, develop,
    the ugly FeCl3 etching, and then hand-solder.
    The PCB is single sided of course.

    I use the lauchpad for programming.

    The white LEDs of the display are pretty bright at their nominal current.
    I wanted something low power and just enough brightness to see the time in the
    middle of the night with darkness-adapted eyes.
    So at 4:30 in the morning, the display is much more useful than an LCD.

    The whole thing draws around 0.3- 0.5mA, LEDs included.
    CPU runs at 1Mhz, but is in LPM3 most of the time, even though the poor thing has
    a restless sleep: it has to wake up 512 times a second, to do the multiplexing.

    At this low current there are quite a few options for a power supply, I considered

    - 2 AA cells; would run around half a year
    - something solar, with supercap
    - I ended up with direct AC supply via a capacitive dropper, 4700pF mains rated film
    cap. Where I live, plugs are polarized, so I know which one if life and which one
    is neutral. Still I think that this would not be street-legal without double insulation
    housing.

    Overall I calculated 2milliwatt total power consumption, probably the lowest of
    any mains powered clock.

    If anybody is interested, I might bring schematic and software into
    human-readable form.
     


  5. Like
    maelli01 got a reaction from bluehash in Tiny low power LED clock   
    Hello,

    Oh no, not another clock...

    My first standalone MSP430 project and also my first project to
    be programmed "in circuit", and a soldering exercise for the TSSOP housing

    A tiny LED clock. It is minimalistic by all means:
    -a TSSOP G2452, no other IC
    -only one button to set the time
    -a dumb 4 digit white LED 7 segment display, https://www.sparkfun.com/products/11409
    -a PCB size of 25mm x 25mm
    -extremely low power

    Wanted to find out whether I can use the TSSOP with my usual home made setup,
    that is Eagle, Deskjet printer, photosensitive base material, UV-lamp, develop,
    the ugly FeCl3 etching, and then hand-solder.
    The PCB is single sided of course.

    I use the lauchpad for programming.

    The white LEDs of the display are pretty bright at their nominal current.
    I wanted something low power and just enough brightness to see the time in the
    middle of the night with darkness-adapted eyes.
    So at 4:30 in the morning, the display is much more useful than an LCD.

    The whole thing draws around 0.3- 0.5mA, LEDs included.
    CPU runs at 1Mhz, but is in LPM3 most of the time, even though the poor thing has
    a restless sleep: it has to wake up 512 times a second, to do the multiplexing.

    At this low current there are quite a few options for a power supply, I considered

    - 2 AA cells; would run around half a year
    - something solar, with supercap
    - I ended up with direct AC supply via a capacitive dropper, 4700pF mains rated film
    cap. Where I live, plugs are polarized, so I know which one if life and which one
    is neutral. Still I think that this would not be street-legal without double insulation
    housing.

    Overall I calculated 2milliwatt total power consumption, probably the lowest of
    any mains powered clock.

    If anybody is interested, I might bring schematic and software into
    human-readable form.
     


  6. Like
    maelli01 got a reaction from manhdan in PWM glitches, Analog Write   
    now I can do fun things with PWM
     
    feed a 1kHz sine wave into Pin2, go through this shortish sketch:
    void setup() {analogFrequency(20000);} void loop()  {analogWrite(9,analogRead(2)/4);} look at the signal on pin 9, blue trace, low pass filtered yellow trace.
     
     
    With the new library: nice 1kHz PWMded sinewave on a 20Khz carrier!
    With the old library: garbage.
     
     
    the loop() runs with 6.8kHz, should be fast enough for very low quality audio
    stuff...


  7. Like
    maelli01 got a reaction from jsolarski in PWM glitches, Analog Write   
    now I can do fun things with PWM
     
    feed a 1kHz sine wave into Pin2, go through this shortish sketch:
    void setup() {analogFrequency(20000);} void loop()  {analogWrite(9,analogRead(2)/4);} look at the signal on pin 9, blue trace, low pass filtered yellow trace.
     
     
    With the new library: nice 1kHz PWMded sinewave on a 20Khz carrier!
    With the old library: garbage.
     
     
    the loop() runs with 6.8kHz, should be fast enough for very low quality audio
    stuff...


  8. Like
    maelli01 got a reaction from roadrunner84 in PWM glitches, Analog Write   
    now I can do fun things with PWM
     
    feed a 1kHz sine wave into Pin2, go through this shortish sketch:
    void setup() {analogFrequency(20000);} void loop()  {analogWrite(9,analogRead(2)/4);} look at the signal on pin 9, blue trace, low pass filtered yellow trace.
     
     
    With the new library: nice 1kHz PWMded sinewave on a 20Khz carrier!
    With the old library: garbage.
     
     
    the loop() runs with 6.8kHz, should be fast enough for very low quality audio
    stuff...


  9. Like
    maelli01 got a reaction from spirilis in PWM glitches, Analog Write   
    now I can do fun things with PWM
     
    feed a 1kHz sine wave into Pin2, go through this shortish sketch:
    void setup() {analogFrequency(20000);} void loop()  {analogWrite(9,analogRead(2)/4);} look at the signal on pin 9, blue trace, low pass filtered yellow trace.
     
     
    With the new library: nice 1kHz PWMded sinewave on a 20Khz carrier!
    With the old library: garbage.
     
     
    the loop() runs with 6.8kHz, should be fast enough for very low quality audio
    stuff...


  10. Like
    maelli01 reacted to spirilis in PWM glitches, Analog Write   
    @@maelli01 - If you'd like to test my variation of the analogWrite stuff, pop this file into your energia-0101E0012\hardware\msp430\cores\msp430 directory:
    https://raw.githubusercontent.com/energia/Energia/af7236c9f45992cfc5780f172a165fede5bae2a9/hardware/msp430/cores/msp430/wiring_analog.c
    It replaces "wiring_analog.c"
     
    If you happen to be using the F5529 LaunchPad with this too, please also grab this:
    https://raw.githubusercontent.com/energia/Energia/af7236c9f45992cfc5780f172a165fede5bae2a9/hardware/msp430/variants/launchpad_f5529/pins_energia.h
    and put it in energia-0101E0012\hardware\msp430\variants\launchpad_f5529 - it replaces pins_energia.h
  11. Like
    maelli01 reacted to spirilis in PWM glitches, Analog Write   
    There's a patch in the works to get Energia to do this right but it's not quite committed due to some details to work out with interrupts. It uses IRQs in conjunction with the timers to "double buffer" any pwm updates.
     
    Sent from my Galaxy Note II with Tapatalk 4
  12. Like
    maelli01 reacted to roadrunner84 in PWM glitches, Analog Write   
    The problem that occurs is intrinsic to the way the PWM (timer) behaves.
    The timer is counting from 0 up to TACCR0 (Timer A capture / compare register 0), then it resets to 0 and starts again.
    In the mean while TACCR1 and TACCR2 monitor the value of the counter and set or clear certain flags when they are equal to the counter value.
    Now imagine this counter to be counting up:
    0, 1, 2... 98, 99, 100, 101, 102... 253, 254, 0, 1.... Now every so much time you change TACCR1 by means of analogWrite(). This will be fine if you change from 100 to 150, the flags will be updated 50 counts later.
    If however you change from 150 to 100 just as the counter is in between 100 and 150 you got a problem:
    the capture/compare unit will not trigger at 100, nor at 150. Instead, the counter will roll over to 0 again, and the next time it hits 100 again, just then it will trigger the capture/compare unit.
     
    The only real solution is to define a well behaved system for this exception. Here are some suggestions:
    - After the delay(15) set a flag, then have an interrupt trigger on the roll over of the counter. When the rollover occurs and the flag is set, update analogWrite().
    - After the delay(15) wait for the output to drop to low value, then update with analogWrite().
    - Instead of delay(15), count a number of timer rollovers, then your update will always be close to the point where the counter is 0.
×
×
  • Create New...