Embedded Freaks..

July 10, 2009

Simple rectifier for MCU PSU

Filed under: embedded-tips — Tags: — kunilkuda @ 11:55 pm

A friend of mine told me about simple rectifier configuration that’s usually deployed in white goods (iron, washing machine, vacuum cleaner, etc). You can view the explanation here and here. It’s very interesting to know that you actually don’t need a big transformer or even switching PSU to supply your MCU from AC source.

Here’s my schematic for my own board:

(more…)

May 9, 2009

Linear PSU Efficiency Quiz

Filed under: embedded-tips — Tags: — kunilkuda @ 6:15 pm

Moving out to Singapore, I’ve become nearly disabled. No solder, no board, no multimeter, etc. Actually, my employer provides me with the tools, but I’m kinda hesitated to use it for my own personal use. I guess I have to buy it for my own later.

Anyway, since I’ve got nothing to do this Sunday, I’ve come up with quizzes, just to test my electronic insanity. What is the efficiency of these ugly linear PSUs ?

Simple Zener Rectifier

Simple Zener Rectifier

I’d say its efficiency is 17.59%..Here’s another one:

Current Feedback Linear Rectifier

Current Feedback Linear Rectifier

My insanity said that it’s efficiency is 17.64%.

Is there anyone who has different answer than me ? :)

February 10, 2009

Removing Unused Functions/Dead Codes with GCC/GNU-ld

Filed under: embedded-tips — Tags: — kunilkuda @ 10:25 am

I was suprised to know that GCC failed to remove the dead codes from my program. Here’s an example:

kunil@cerpelai:~/Temp$ vi test.c
#include

void unusedFunction(void) {
  printf(“This is a dead code\n”);
}

int main(void) {
  printf(“Hello world\n”);
  return 0;
}

kunil@cerpelai:~/Temp$ gcc -Os test.c -o test.elf

If you take a look carefully on the ELF binary, you can see that GCC still includes the “unusedFunction()”, although nothing refers to it.

kunil@cerpelai:~/Temp$ objdump -d test.elf

test.elf:     file format elf32-i386
….
080483c4

:
….
080483e9 :
….

So I was wondering if there’s something wrong with GCC (or GNU-ld), or should I add something to remove it.
(more…)

Older Posts »

Blog at WordPress.com.