Skip to main content

Messages

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

Messages - NiHaoMike

1
Project development, ideas, and suggestions / OpenDAC HD: An open hardware HD audio DAC
https://github.com/NiHaoMike/OpenDAC-HD
Long story short, it began when I had to teach an intern how to solder and I decided to have her put together an audio wiring harness for a personal project I was working on. In the process, I accidentally discovered her magical ability to improve audio quality. Since I had a limited amount of time to work with her in the real world (after which she has to go back to study and then it could be years before I get another chance), I decided to build a very good headphone DAC/amp that combines some of the best DAC and opamp chips on the market with her "magic charm".
2
General discussion / dsPIC MCPWM period skipping
I'm working on an inverter with a dsPIC controller. I have the sine wave generation code running well, but now I want to add period skipping at particularly high or low duty cycles in order to improve efficiency. For those who don't specialize in power electronics, period skipping is a trick that involves alternating between periods of full on or full off and periods where the on time or off time is doubled, effectively halving the switching frequency.

Here's (part of) the code:
Code: [Select]
unsigned int pwm;
//code to calculate initial PWM value
if(pwm>600) {
    if(PWMtick&0x1) { //PWMtick is a variable that increments every PWM period
          pwm=(pwm<<1)-801; //this doesn't seem to work
          if(pwm>775)
              pwm=801; //801 commands 100% duty cycle
    }
    else
          pwm=801;
}
else if(pwm<200) {
    if(PWMtick&0x1) {
          pwm=pwm<<1; //but this does!
          if(pwm<25)
              pwm=0;
    }
    else
          pwm=0;
}
The result is that at low duty cycles, it does indeed skip periods as intended. But at high duty cycles, it just abruptly switches to full on. The code for the high and low duty cycles are identical except for some comparison constants and the PWM value calculation. Is there something peculiar about the dsPIC and/or the XC16 compiler that causes that calculation to fail?
3
General discussion / best free RTOS for dsPIC
What free RTOS would you recommend for use on dsPIC? I looked at Q-Kernel but there are basically no examples of how to use it. Performance isn't all that critical so I'd prefer something that's easy to get started with. (It's my first time running a RTOS on a microcontroller.)
5
Project development, ideas, and suggestions / Re: Monitor backlight flicker measurement
Wrap the circuit in aluminum foil and ground the foil. You might also want to try adding shunt resistance.

Pixel Qi actually uses the switching effect to its advantage. The idea is to use a LCD without color filters and a backlight that cycles through all 3 primary colors very quickly, exactly like DLP. (I presume they cycle through all colors at least once in a frame to prevent color breakup.) Since the color filters are only about 33% efficient, doing away with them theoretically makes the display 3 times as efficient. It can also be designed to work like Eink by turning off the backlight.
6
Bus Pirate Support / Bus Pirate short circuit protection
I was working on a small plasma display module out of a broken car radio, and one annoying feature of the Bus Pirate is that the inrush of the DC/DC converter false trips the overcurrent protection. I can (and did) edit the source code to decrease the sensitivity of the protection, but I'm using a homemade version of the Bus Pirate that can survive a short circuit even if the firmware does not intervene. Would the official Bus Pirate survive that?  (All I did was increase the delay so it waits 100ms before checking for a short rather than 2ms.)
7
Bus Pirate Support / Invert data output in SPI mode?
I'm trying to get a small SPI plasma display (text only, got out of a broken car radio) working, and I'm running into a problem because the level shifters on the module invert all the lines, including the data line. (The inrush from the DC/DC converter also false trips the overcurrent protection, but I worked around it by using a bench power supply to run it.)

Is it possible to set the Bus Pirate to invert the data line? (I could XOR each byte by 0xFF, but that can get confusing to say the least.)
8
Project development, ideas, and suggestions / Re: Is this AVR idea possible and for a "reasonable" price
You'll want to use a dsPIC or equivalent to do all the heavy DSP stuff. Also don't use transformers for voltage sensing since they will be slightly nonlinear unless you get some specifically for that use. Just use a string of resistors as a voltage divider and ground your circuit. (3x 470k in series for the high side and 10k to a buffered reference yields a nice 1.2V or so peak signal for digitization by a 3.3V ADC.)

BTW, if all you want is an imbalance indicator, you can just put 3 resistors (4.7k, 5W) to each of the hots along with pair of high brightness LEDs from the midpoint to neutral.
9
USB Infrared Toy / Cost saving idea for v3
Reading through the documentation for the USB Infrared Toy (I'm planning to build a version to integrate into a PC), I noted that the sensor added for frequency detection is quite expensive. Since it's only used for learning remotes (don't need much range), maybe it can be replaced with a cheaper device? Maybe a plain phototransistor or photodiode would work well. Or maybe add a 10k or so resistor across the IR LED and AC couple it through a single transistor amplifier. (I have actually seen that used in a learning remote.)
10
General discussion / Re: VGA will be phased out in 2015
There's plenty of old stuff out there that can handle it. And in practice, monitors are probably going to keep having VGA input for a long time to handle all the legacy systems out there.
11
Bus Pirate Support / Re: Control the Bus Pirate using a Android Tablet PC
Do a dmesg on the Android device a few seconds after plugging in the Bus Pirate. Also look in the /dev directory and there should be a ttyUSB0 file corresponding to it.

It sounds like you might have the wrong baud rate or the software is not setting it correctly.
12
Bus Pirate Support / Re: Control the Bus Pirate using a Android Tablet PC
If it does not work, the kernel must support the USB to serial converter (FTDI on a v3, CDC ACM on a v4 or my version of the v3 that uses a second PIC) and the OS must set the proper permissions to allow access without rooting. (If your device can be rooted, I recommend doing so.)

My TF101 (with the keyboard attachment) running Android Revolution HD 3.6 does not work with FTDI because it doesn't have the proper drivers (bummer), but PL2303 and CDC ACM work like a charm. As for a terminal program, I use ConnectBot and Busybox (the microcom app packaged in it).
13
Bus Pirate Support / Re: What have you used your Bus Pirate for?
Used it to flash Redboot onto an old WGT624. (I actually have a homemade Bus Pirate that is about 4 times as fast as the official one - I just replaced the FTDI with another PIC, upped the UART to 500kbps, and enabled CTS/RTS.)
14
Project development, ideas, and suggestions / Re: EEPROM Data Miner?
[quote author="Sjaak"]interesting idea. Would you also try to emulate the eeprom or just eavesdrop on the comunication?

In our svn there is a project called buspiratedemo board which has the slave version of the memory chips (both SPI and I2C), This will give you a nice start.[/quote]
Just sniffing the bits should work nicely. Doing a "man in the middle" would allow more possibilities, but increases the complexity by a lot.
15
Project development, ideas, and suggestions / EEPROM Data Miner?
I have taken apart a number of devices (plug in power meters, digital bathroom scales, etc.) that log data to an I2C or (low frequency) SPI EEPROM or Flash chip. How feasible would it be to create a cheap module that taps into the bus, intercepts the writes, and transmits the data wirelessly to a PC or other central node? (Basically, it would be a very simple logic analyzer designed specifically for this purpose. It would be the receiver's job to interpret the data.)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01532430656session_write_close ( )...(null):0
20.01572562272ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01572563048Database_MySQL->query( ).../DatabaseHandler.php:119
40.05992701808Database_MySQL->error( ).../Db-mysql.class.php:273