archive-org.com » ORG » S » SPITZENPFEIL.ORG

Total: 480

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Mental illness in microcontrollers — or in the programmer ? | My 2µF
    the delays introduced by the soft uart receiver interrupt CTC mode compare match writing to OCR1X registers hmmmmmmmmmm If everything works out as it should timer1 counts up from 0 to OCR1A resets the counter to 0 and sets the interrupt flag for the compare match interrupt The interrupt is then executed at the next possible slot The hardware counter is not affected if the interrupt runs or not or when This looks like a sawtooth waveform if plotted At several spots in the ISR there is code like OCR1A some value 1 OCR1A some value It is imperative that this happens before the timer has reached some value If this time is missed delays by pin change interrupt timer1 has to count up all the way to 65536 and wrap around to 0 again In case of a 16bit timer clocked at 31 25kHz this takes about 2 seconds For normal human beings this period of time is quite obvious Especially if the lights should be turned ON What to do Stop timer1 while the pin change ISR is running That would also interfere with the LED part The compare match ISR takes about 5µs to complete the soft uart interrupt takes about 1ms YES that is terribly long I know The half bit time at 9600bps is about 52µs Shifting the center by 5µs is quite tolerable Therefore I chose to have the pin change interrupt run as such ISR PCINT0 vect ISR NOBLOCK pin change interrupt group 0 disable pin change interrupts on group 0 ASAP it should be re enabled elsewhere after the data has been processed GIMSK BV PCIE0 soft UART receiver uint8 t ctr if PINA BV PA0 PA0 is low start bit beginning of start bit delay us HALF BIT DELAY center of start bit delay us HALF BIT DELAY end of start bit delay us HALF BIT DELAY center of data bit 0 for ctr 0 ctr 7 ctr receive byte LSB first if PINA BV PA0 bit is set soft uart rx byte BV ctr enter a 1 else bit is not set soft uart rx byte BV ctr enter a 0 delay us FULL BIT DELAY now we should be at the center of the stop bit if PINA BV PA0 stop bit is HIGH as it should be soft uart rx flag 1 volatile uint8 t else soft uart rx flag 0 volatile uint8 t void setup soft uart rx isr void PCMSK0 BV PCINT0 select pin change interrupt on PA0 GIMSK BV PCIE0 enable pin change interrupts on group 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 ISR PCINT0 vect ISR NOBLOCK pin change interrupt group 0 disable pin change interrupts on group 0 ASAP it should be re enabled elsewhere after the data

    Original URL path: http://blog.spitzenpfeil.org/wordpress/2011/07/11/mental-illness-in-microcontrollers-or-in-the-programmer/ (2016-02-10)
    Open archived version from archive


  • CTC | My 2µF
    the ATtiny24s don t have a Continue reading Posted in Electronics Fix me Software Tagged AVR CTC interrupt ISR ISR NOBLOCK pitfall timer Leave a comment Search for Recent Comments robert on YauDL Y et a nother u seless D ummy L oad Andrew Duckworth on YauDL Y et a nother u seless D ummy L oad robert on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Archives Archives Select Month January 2016 1 December 2015 2 November 2015 3 October 2015 2 September 2015 10 July 2015 4 June 2015 5 May 2015 2 April 2015 5 March 2015 3 February 2015 2 January 2015 1 December 2014 2 November 2014 2 October 2014 3 September 2014 1 August 2014 2 July 2014 2 June 2014 2 May 2014 2 April 2014 4 March 2014 3 February 2014 2 January 2014 1 December 2013 3 November 2013 6 October 2013 3 August 2013 3 July 2013 2 June 2013 6 May 2013 6 February 2013 2 January 2013 5 December 2012 1 August 2012 2 July 2012 7 June 2012 6 May 2012 5 April 2012 6 March 2012 2 February 2012 1 January 2012 3 December 2011 5 October 2011 2 September 2011 1 August 2011 1 July 2011 3 June 2011 1 March 2011 2 February 2011 5 January 2011 2 December 2010 3 November 2010 2 October 2010 1 September 2010 1 July 2010 2 June 2010 2 May 2010 4 March 2010 2 February 2010 2 January 2010 2 December 2009 6 November 2009 1 October 2009 2 September 2009 1 August 2009 4 July 2009 8 June 2009 6 May 2009 3 April 2009

    Original URL path: http://blog.spitzenpfeil.org/wordpress/tag/ctc/ (2016-02-10)
    Open archived version from archive

  • ISR | My 2µF
    interrupt ISR ISR NOBLOCK pitfall timer Leave a comment ATtiny 2313 MBI5168 3W LED Posted on February 12 2011 by robert Towards re illuminating my kitchen workspace Posted in Electronics Tagged ATtiny 2313 AVR driver ISR LED MBI5168 oscilloscope PWM Leave a comment Search for Recent Comments robert on YauDL Y et a nother u seless D ummy L oad Andrew Duckworth on YauDL Y et a nother u seless D ummy L oad robert on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Archives Archives Select Month January 2016 1 December 2015 2 November 2015 3 October 2015 2 September 2015 10 July 2015 4 June 2015 5 May 2015 2 April 2015 5 March 2015 3 February 2015 2 January 2015 1 December 2014 2 November 2014 2 October 2014 3 September 2014 1 August 2014 2 July 2014 2 June 2014 2 May 2014 2 April 2014 4 March 2014 3 February 2014 2 January 2014 1 December 2013 3 November 2013 6 October 2013 3 August 2013 3 July 2013 2 June 2013 6 May 2013 6 February 2013 2 January 2013 5 December 2012 1 August 2012 2 July 2012 7 June 2012 6 May 2012 5 April 2012 6 March 2012 2 February 2012 1 January 2012 3 December 2011 5 October 2011 2 September 2011 1 August 2011 1 July 2011 3 June 2011 1 March 2011 2 February 2011 5 January 2011 2 December 2010 3 November 2010 2 October 2010 1 September 2010 1 July 2010 2 June 2010 2 May 2010 4 March 2010 2 February 2010 2 January 2010 2 December 2009 6 November 2009 1 October 2009 2

    Original URL path: http://blog.spitzenpfeil.org/wordpress/tag/isr/ (2016-02-10)
    Open archived version from archive

  • ISR_NOBLOCK | My 2µF
    As the ATtiny24s don t have a Continue reading Posted in Electronics Fix me Software Tagged AVR CTC interrupt ISR ISR NOBLOCK pitfall timer Leave a comment Search for Recent Comments robert on YauDL Y et a nother u seless D ummy L oad Andrew Duckworth on YauDL Y et a nother u seless D ummy L oad robert on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Archives Archives Select Month January 2016 1 December 2015 2 November 2015 3 October 2015 2 September 2015 10 July 2015 4 June 2015 5 May 2015 2 April 2015 5 March 2015 3 February 2015 2 January 2015 1 December 2014 2 November 2014 2 October 2014 3 September 2014 1 August 2014 2 July 2014 2 June 2014 2 May 2014 2 April 2014 4 March 2014 3 February 2014 2 January 2014 1 December 2013 3 November 2013 6 October 2013 3 August 2013 3 July 2013 2 June 2013 6 May 2013 6 February 2013 2 January 2013 5 December 2012 1 August 2012 2 July 2012 7 June 2012 6 May 2012 5 April 2012 6 March 2012 2 February 2012 1 January 2012 3 December 2011 5 October 2011 2 September 2011 1 August 2011 1 July 2011 3 June 2011 1 March 2011 2 February 2011 5 January 2011 2 December 2010 3 November 2010 2 October 2010 1 September 2010 1 July 2010 2 June 2010 2 May 2010 4 March 2010 2 February 2010 2 January 2010 2 December 2009 6 November 2009 1 October 2009 2 September 2009 1 August 2009 4 July 2009 8 June 2009 6 May 2009 3 April

    Original URL path: http://blog.spitzenpfeil.org/wordpress/tag/isr_noblock/ (2016-02-10)
    Open archived version from archive

  • I shall smite yee till kingdom come — Arrrrrr! | My 2µF
    Pretty much the only two things that are beyond ANY control are the reading lights and the cigarette lighter The latter is used for heating the driver s seat which has killed a few batteries as well But the reading lights they have tortured me many times but not anymore Behold Mr Blinky LED This one had a wrong capacitor 220pF instead of 220nF and was therefore blinking at about 3kHz I m not that fast Having a frequency counter in my digital multimeter is quite nice The displayed RMS value was 5V a bit low I think For a square wave the average and RMS should be the same no The circuit was powered with 12V so I expected 6V The green LED was way too weak as well Version 2 comes with a more suitable capacitor of 1µF Together with 1MΩ it blinks at about 1Hz clearly visible to humans The circuit can be found in the datasheet Component count is minimal The camera doesn t properly show the contrast between the LED and the light bulb In reality it s much more visible Placement of the LED isn t ideal as well but I don t have access to drills and other tools right now And now with sound if you can call it that way Better turn down the volume I wish the engineers at VW had included something like this when they were designing this car Even better they should have added a buzzer or as in more modern cars auto power off Oh well I was also thinking about adding a shunt resistor to my car s battery but I m not sure how much I would have to shell out for one capable of say 500A or something Its resistance would have to be of extremely low value and I d definitely need a decent opamp for it For e g a burden voltage of 250mV 500A that would be 0 5mΩ To get a resolution of say 50mA I d have to reliably measure voltage steps of 25µV in a noisy car Nope Somebody else can have a go at that This entry was posted in Electronics Fix me and tagged battery car lights Bookmark the permalink Failure by Design My digital power supply Microcontroller Contest on Expli de Electronics kits to win 2 Responses to I shall smite yee till kingdom come Arrrrrr DavidCary says May 27 2010 at 23 53 Have you looked at magnetic current sensors They can attach around the battery cable magnetic current sensors don t need a shunt resistor Reply robert says May 28 2010 at 00 41 Ah I didn t think of that Silly me I ll go and have a look at clamps The whole current monitoring business needs a bit too much effort for just taming a rogue reading light though I don t want to think about how I d get the signal wires to the lamp either Besides this problem

    Original URL path: http://blog.spitzenpfeil.org/wordpress/2010/05/25/i-shall-smite-yee-till-kingdom-come-arrrrrr/ (2016-02-10)
    Open archived version from archive

  • lights | My 2µF
    May 25 2010 by robert ENOUGH OF THIS INSANITY In my previous post I described how and why I ve temporarily wrecked my beloved power supply Thankfully these 390mΩ 5W resistors are available Right now I could only find 5 types but bettar tan nottin Continue reading Posted in Electronics Fix me Tagged battery car lights 2 Comments Search for Recent Comments robert on YauDL Y et a nother u seless D ummy L oad Andrew Duckworth on YauDL Y et a nother u seless D ummy L oad robert on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Archives Archives Select Month January 2016 1 December 2015 2 November 2015 3 October 2015 2 September 2015 10 July 2015 4 June 2015 5 May 2015 2 April 2015 5 March 2015 3 February 2015 2 January 2015 1 December 2014 2 November 2014 2 October 2014 3 September 2014 1 August 2014 2 July 2014 2 June 2014 2 May 2014 2 April 2014 4 March 2014 3 February 2014 2 January 2014 1 December 2013 3 November 2013 6 October 2013 3 August 2013 3 July 2013 2 June 2013 6 May 2013 6 February 2013 2 January 2013 5 December 2012 1 August 2012 2 July 2012 7 June 2012 6 May 2012 5 April 2012 6 March 2012 2 February 2012 1 January 2012 3 December 2011 5 October 2011 2 September 2011 1 August 2011 1 July 2011 3 June 2011 1 March 2011 2 February 2011 5 January 2011 2 December 2010 3 November 2010 2 October 2010 1 September 2010 1 July 2010 2 June 2010 2 May 2010 4 March 2010 2

    Original URL path: http://blog.spitzenpfeil.org/wordpress/tag/lights/ (2016-02-10)
    Open archived version from archive

  • Failure by Design – My digital power supply | My 2µF
    mine it s not quite the same Some of the current setting potentiometers are called Rxx in the PDF and Pxx on the PCB And as usual pull the plug before you stick your fingers in there All in all it is a good device but one aspect of it sucks though AC power voltage mode current mode relay 1 NC relay 2 NO 1 off off off closed NE open NE 2 on off off open NE open NE 3 on on off open E closed E 4 on off on closed NE open NE NC normally closed NO normally open NE not energized E energized As you can see case 1 and 4 are identical as far as the relays are concerned BUT in case 4 we have power applied to the transistors In current mode the relays have the same switch state as in case all AC power is gone The same thing happens when two fuses are blown the left ones in the picture below which supply the logic with power which is exactly what happened here If the microcontroller and the relays don t get any power relay 1 shorts the output terminals as if in current mode 4 and all the power gets pumped into the transistors Also the current shunt R22 0 39Ω 5W gets way too hot and burns its insulation I will have to replace this current shunt resistor Some of the windings may touch anytime and confuse the current regulation completely The only advantage of having shorted to when the AC power is gone is that the smoothing capacitor is rapidly discharged and the output voltage drops fast This may be desired as well but it is definitely NOT desirable that a power supply shorts itself when the fuses for the microcontroller blow They should have added another 5V relay to disconnect the main transformer winding from the power transistors if the control logic is offline I assume that when a fuse inside a device blows it should be in a much safer state afterwards Here it was quite the opposite I think The control logic board might have started to burn without the fuse but 75W being pumped into the power transistors for several hours and a blazing hot heatsink is not exactly safe as well WTF Oh and while I m at it have a look at some of the solder joints I could have tolerated it for ordinary low current connections but these wires are connected to the power transistors The rightmost pad is just sad It should have been the same size as the other ones You just don t want to see what it looks on the other side Now how do we make this thick wire stick to such a tiny pad This entry was posted in Electronics Fix me and tagged failure by design linear power supply relay short Bookmark the permalink RGB LED Ring now available as DIY SMD kit I shall

    Original URL path: http://blog.spitzenpfeil.org/wordpress/2010/05/24/failure-by-design-my-digital-power-supply/ (2016-02-10)
    Open archived version from archive

  • linear | My 2µF
    35 and 18132 4350009427 It s the black Continue reading Posted in Electronics Fix me Tagged failure by design linear power supply relay short 2 Comments Search for Recent Comments robert on YauDL Y et a nother u seless D ummy L oad Andrew Duckworth on YauDL Y et a nother u seless D ummy L oad robert on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Serhii on YOUYUE 858D hotair station BLDC Fan speed mod Archives Archives Select Month January 2016 1 December 2015 2 November 2015 3 October 2015 2 September 2015 10 July 2015 4 June 2015 5 May 2015 2 April 2015 5 March 2015 3 February 2015 2 January 2015 1 December 2014 2 November 2014 2 October 2014 3 September 2014 1 August 2014 2 July 2014 2 June 2014 2 May 2014 2 April 2014 4 March 2014 3 February 2014 2 January 2014 1 December 2013 3 November 2013 6 October 2013 3 August 2013 3 July 2013 2 June 2013 6 May 2013 6 February 2013 2 January 2013 5 December 2012 1 August 2012 2 July 2012 7 June 2012 6 May 2012 5 April 2012 6 March 2012 2 February 2012 1 January 2012 3 December 2011 5 October 2011 2 September 2011 1 August 2011 1 July 2011 3 June 2011 1 March 2011 2 February 2011 5 January 2011 2 December 2010 3 November 2010 2 October 2010 1 September 2010 1 July 2010 2 June 2010 2 May 2010 4 March 2010 2 February 2010 2 January 2010 2 December 2009 6 November 2009 1 October 2009 2 September 2009 1 August 2009 4 July 2009 8 June 2009 6 May 2009 3 April 2009

    Original URL path: http://blog.spitzenpfeil.org/wordpress/tag/linear/ (2016-02-10)
    Open archived version from archive



  •