Skip to main content


This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - Destate9

General discussion / Precise analog voltage from PWM
So I've been trying to make a constant current H-bridge circuit for a project, and I'm running into trouble with PWM.  Right now, all I have connected to the Output compare pin of my PIC32MX microcontroller is a 330uF capacitor (Max ESR of 1.4 ohms according to datasheet).  I assumed a 50% duty cycle (at VCC = 3.3V) would yield 1.65V, but that is not the case.  As you can see in my attached picture, the output voltage (y-axis) vs Duty Cycle (divide the x-axis by 65535) looks a little more like a CDF.  I know there must be a way to calculate this function based on the capacitor charging and discharging, but I've been scratching my head for a while, and was wondering if anyone else has derived this function.

Project development, ideas, and suggestions / Single voice command recognition
Yo, I'm trying to make a PIC based board that will switch a relay when it receives a voice command.  The relay will switch house lights on and off.  So basically, this will be like the clapper, only I'm hoping the command input will be complicated enough so it won't be triggered by knocking or general hubbub.  I know there is a speech recognition library for the dsPIC, but I want to keep it relevantly simple.
Project logs / PICShift
Here is a board with the 50x31 Sick of Beige case.

This board uses a 6-pin PIC (PIC10F322) to generate a pulse of an exact length from the rising edge of a button.  This is going on The Ohio State University's formula car (, and will actuate our pneumatic shifters.  Originally we used a monostable 555 circuit to generate the pulse, but we wanted something we could program different times into rather than adjusting a potentiometer.  Also, since this is going on a formula car with a lot of vibrations, we try and avoid potentiometers when we can.

Here are some more pics of the board:

(Those are the MOSFETs we use to switch power for the pistons on the back)

(5V section of the board to the left of the divide, 12V section to the right)

(Schematic of the board.  Pretty simple stuff, except using the ICSP header and 4 IO can be a bit challenging on a 6 pin PIC.  I also had to be sure no one could mess up and send erratic signals to the shifters, potentially damaging the system.  Notice that DAT and CLK can't be connected while the MOSFETs are connected)

This was my first project involving polygons, PIC, Sick of Beige, and Eagle (although I have used NI multisim).  So all and all this was a really interesting learning experience.

Big shout out to Ian for the advice/support!  Also, this being my first PIC project, this site was incredibly helpful, so a big thank you to all you forum people as well!  Finally, although we will be switching to Seeed, Laen has been an awesome PCB service.  So thanks, Laen!
Project logs / Shift light display
So I'm working with the Ohio State University formula team ( on a new shift display for our car, and we want to use SMD LEDs.  We are going to send the board serial data, which will be received by some sort of constant current LED sink driver IC like the TLC5916.  The end result of this board will be a SMD LED matrix meter that will tell the driver when it's time to shift based of RPM data from our ECU.

I'm wondering what size/spacing is practical for the LEDs.  What was used on the latest Dangerous Prototypes badge?  I want it to be compact, but I still want some of our new guys to be able to solder them together.  Immediately I thought of the badge, but I can't find any info on it.
General discussion / XC8 ms delay issues
Yo, I'm in my first PIC project, and I'm using a 6 pin PIC10F322 with the XC8 compiler.  I'm trying to put in some ms delays but when I use the command "__delay_ms(10);" it gives me the error "Unable to resolve identifier __delay_ms()."  I've been checking online, and I've seen people claim that it is a bug in the compiler, or even with MPLABX.  It will compile, but it still shows up red.  It's one of those things that I can put up with, but I'd like it to go away (like Ke$ha).

Also, when I try to configure the configuration bits ("__CONFIG(WRT=OFF);" for example) it gives me a relocation error and I have to comment them out.  What is the traditional way to configure bits with XC8?

Finally, quick question:  What is the difference between using "" with #include and using <> with #include?

Breakout boards / LEDs normally off
So I was thinking about getting one of these power supplies and I was reviewing the schematic when I noticed the LEDs.  The LEDs are on when the output is functioning correctly (fuse is not tripped) and off when the outputs aren't functioning correctly (fuse is tripped), correct?  I was thinking with the addition of a resistor and transistor for each output (looks like there's plenty of room on the board) you could make it so the LED turn on when the fuse trips.  Some might not think it's worth the extra money for parts to change this function of the board, but I think it would make it even easier to identify problems.

Attatched I have an example of what I'm talking about.

Anywho, just throwing it out there.