Show Posts
Pages: 1 ... 149 150 [151]
2251  Using Arduino / Microcontrollers / Re: Help using PIC? on: September 24, 2012, 04:38:18 pm
That chip is self-programmable.

Two ways to approach it:

1) you can use a bootloader - they are many of them floating around;
2) you can code it yourself - either by manipulating the registers or pick a compiler that has a canned solution for that.

Neither is complicated.
2252  Using Arduino / General Electronics / Re: How come my MOSFET was a "smoking", I thought it was rated high enough. on: September 24, 2012, 04:32:47 pm
I did not have a heatsink on it.

A 12v 50w bulb has a resistance of 3ohm when fully lit, and much lower when cold, like when it is driven from a 5v source.

Let's say that it has a cold resistance of 0.3ohm, and the current going through it is 15amp. That creates 15*15*8mohm = 2w of power dissipation on your mosfet.

The datasheet suggests that your mosfet has a thermal resistance of 62c/w -> at 2w of dissipation, its temperature rise is 120c -> buff!

I would suggest that you use a beefier device (to220) and put a heatsink on that mosfet.
2253  Using Arduino / Displays / Re: Can you "invert" the LCD display? on: September 24, 2012, 04:10:13 pm
For graphic lcds, it is simply inverting the bit map data.

For character lcds (hd44780), you are limited by the custom chacters.
2254  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: September 24, 2012, 04:06:43 pm
I wouldn't trust ebay for something like this, especially when you have no equipment to confirm their reliability / accuracy.

Go to a reputable distributor and search for oscillator and you will find thousands of listing. Most of them allow for filtering, making it easy for you.

A big consideration will be intended applications. If you want low power consumption, any ocxo-based solutions are out of the window.

If you want to put the mcu into sleep, any solution based on the main oscillator (software rtc) is out of the window, as are hardware rtc modules without its own power domain (Vbat pin).

If you don't want to program. You have to get one of those precision 32khz oscillators - maxim / dallas has one.

2255  Using Arduino / Programming Questions / Re: how to rotate a byte on: September 24, 2012, 06:29:44 am
For left shifts, you can test the high bit and then or it with the shifted data. Similiarly with right shifts.

Something like this:

Mydata = ((mydata & 0x80)?0x01:0x00) | (mydata << 1);

Use 0x8000 for 16-bit types.

Just be careful that the above code is dependent on the sequence of evaluation and you may need to break it down into two statements to avoid that problem.

The right shift version is

Mydata = ((mydata & 0x01)?0x80:0x00) | (mydata >> 1)j

Again, use 0x8000 for 16-bit types.

One word of caution: the above applies to just unsigned types. Right shifting signed types takes special precaution.
2256  Using Arduino / Displays / Re: PWM control LCD Contrast on: September 24, 2012, 06:16:16 am
The avr pins can deliver substantial amount of current (20ma in spec and more if you go out of spec), far more than those contrast control pins typically draw so you don't need that mosfet. Just connect the resistor to a pwm pin and you are done.

Your solution presumes the existence of that -5v. If it doesn't exist, you can generate it via a few diodes + capacitors + a flipping pin.

If you need more current, you can use a high-side switch - a p-channel mosfet or a pnp.
2257  Using Arduino / Microcontrollers / Re: Help using PIC? on: September 24, 2012, 04:48:10 am
A few possibilities:

1) Microchip has a SD library for the 18F chips. And there are various ports of SD card libraries for the 18F chips too.
2) You can use flash space to store data.
3) You can use an outside EEPROM chip for that. 1 8pdip + two resistors. Easy to port.
2258  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: September 24, 2012, 04:41:03 am
A few possibilities:

1) a precision timer like ds323x and their MEM versions.
2) a precision quartz. You can get 5pm quartz fairly inexpensively.
3) Trimming. Some chips offer hardware trimming in their RTC modules. You can use software trimming.

The issue is less with accuracy at a given temperature. The issue is with drifting at different temperatures. So one solution would be to use a temperature sensor and then trim based on that temperature reading.
2259  Using Arduino / Displays / Re: problem with 7Segment 4digits display on: September 22, 2012, 04:03:57 pm
It is your DigitDisplay routine.

It alters the value of NumVal - unless you want to something weird, it looks like you want to display some numbers. If so, you can use an array based on "num" to send out the segment data to the shift register.

Try something like this:

void DigitDisplay(int num)
  int seg_font[]={
    B11000000,             //'0'
    B11111001,             //'1'
    B10100100,             //'2'
    B10110000,             //'3'
    B10011001,             //'4'
    B10010010,             //'5'
    B10000010,             //'6'
    B11111000,             //'7'
    B10000000,             //'8'
    B10011000              //'9'
    digitalWrite(latch , LOW);
    shiftOut(data , clock , MSBFIRST , seg_font[num % 10]);
    digitalWrite(latch , HIGH);

I cannot be sure that the segment information is correct but it is not that difficult for you to create your own, if you want to display something else instead.
2260  Using Arduino / Displays / Re: Warning to users of some vendors LCD keypad shields. on: September 22, 2012, 01:36:37 pm
I measured 95ma being sourced from D10 when D10 is high.

Did  your Arduino die from that experiment?
2261  Using Arduino / Displays / Re: Warning to users of some vendors LCD keypad shields. on: September 22, 2012, 06:28:47 am
AVR's output, even in the push-pull mode, isn't a strong voltage source in that it has substantial output resistance. So even if you short the output pin (in a logic 1), you don't get much current (40-50ma maybe) out of it. The design here isn't a great design but it is not a deadly design either.

One of the schematics linked here had the led between Vcc and the transistor, without a resistor. If that's really the design, the led can draw substantial current under a 5v rail. Leds are pretty good at taking abuses but it is wise to put a resistor in serial with the led.

But that is just my guess.

It could have been designed for an open - collector type of output pin.
2262  Using Arduino / Displays / Re: Warning to users of some vendors LCD keypad shields. on: September 21, 2012, 08:09:31 pm
This is really a non-issue.

It would have been nice if the resistor is on the transistor's base.

But even if it is not, you can still control the backlight via the pin (D10): first, clear D10. After that, if you wish to turn on the back light, turn D10 into an input - the pull-up resistor will now turn on the switch / led; if you wish to turn off the back light, turn D10 into an output - now, D10 will be cleared thus turning off the switch / led.

If you do that in a timer, you can do software PWM and control the backlight brightness continuously.
Pages: 1 ... 149 150 [151]