![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hi all,
I'm looking to use the RA4 pin of a 16F628A as an output, unlike most of the other outputs which can source an LED current, this has an open drain requirement. I was planning on tying this output to VDD (+5v) via an 820R LED limiting resistor, and inverting the logic for the drive of the pin. I can't see any problem with this but thouht I'd like confirmation that this would be acceptable before I get the soldering iron out. Thanks, Roy Last edited by fenderman; 17th June 2008 at 04:33 PM. |
|
|
|
|
|
|
(permalink) |
|
The pullup will work just fine. What are you driving?
|
|
|
|
|
|
|
(permalink) |
|
Hi Bill,
Thanks for your reply. I'm just driving a standard LED (around 6mA), but as the other outputs are all sourcing the LEDS via 'on board (PCB)' 820R resistors wired directly from the PCB to the LEDs, with all the cathodes tied to 0v, I did'nt want to have an odd one where the LED would have been sourced from the VDD and an external resistor and 'sank' via the Open Drain as this would have caused problems in the LED panels, so hence the thought that I'd effectively drive the LED via an 820R resistor to the LED and to 0v, with the open drain pin connected to the junction of the LED Anode and the Resistor. Hence when the Output is 'ON' the LED would be 'shorted' and be 'OFF'. Fortunatly (more by luck than planning), the PCB I designed does have the facility already to accomodate this 'mod' without any additional tracks/or link wires. Thanks for your confirmation, it is appreciated .... I have done it now, and it works fine. Roy |
|
|
|
|
|
|
(permalink) |
|
Oops,
Forgot to mention, the output RA4 Open Drain pin on a PIC16F628A already is implemented to do the 'invert' of the logic, so operates in TRUE logic. The only thing to be aware of here, is that when the PIC first fire's up, (and especially if you are using the Start Up Delay), the output is ON until the first initialisation / drive to PORTA, hence you do get a 'blip' on the output from a HIGH to a LOW. Not a problem on LEDS etc, but may be a problem if driving into other logic. |
|
|
|
|
|
|
(permalink) |
|
It's much easier to sink the LED on RA4, just connect the cathode to RA4 and a output low will turn it on.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Mike. |
||
|
|
|
|
|
(permalink) |
|
Cheers Bill,
I was going to do this, but as I indicated in a previous post, I wanted to retain identical LED external circuitry, where all the other LEDS are being sourced from the outputs (via the on board resistors), and all the cathodes are taken to 0v. This was the reason for 'shorting' the LED with the output as this maintains identical LED wiring externally. Thanks for the suggestion Pommie, I've not tried it yet, but I'll stick a storage scope on it tomorrow and see what happens ... I'll report back the findings accordingly. Roy |
|
|
|
|
|
|
(permalink) |
|
Then turn all your LEDs around.
|
|
|
|
|
|
|
(permalink) |
|
I hadn't realised you were shorting the LED with the output, I assumed the output grounded the LED. My suggestion wont work with your current configuration.
Thinking about it, your method is quite ingenious and makes the logic simpler. A high output always turning the LED on even though RA4 is OC. Clever. Mike. |
|
|
|
|
|
|
(permalink) |
|
What I would do...But I guess there is a reason why you don't want to change the circuitry?
EDIT: AHHH thanks Pommie, now I see why he wants it that way. Good Idea, think I will turn some of my LEDs around then..lol -BaC
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground Last edited by BaCaRdi; 19th June 2008 at 05:22 AM. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
But shorted out all sorts of things in electronics, an obvious example being shorting the input to a transistor out to turn it off - but there have been many such uses over many years. For a pretty identical example check the bottom of my page at Cybot Motor Driver Board |
||
|
|
|
|
|
(permalink) | ||
|
Damned that learning curve!
Cheers Nigel m8, -BaC Quote:
Quote:
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground |
|||
|
|
|
|
|
(permalink) |
|
Cheers All,
The primary reason for sourcing the LED's and 'shorting' the one on the RA4 is that all the LEDS (over 200 of them) are already installed and wired, as these units are replacing the existing driver circuits which was pure TTL logic which were very old and there were no replacement parts available. My 'Brief' was to come up with something to replace the driver circuits, and have ample replacement spare part capability, hence I chose the PIC16F628A as this was my first venture into PICS, but have broken the cardinal rule of design, and did'nt read the data sheet properly ... However, the PCB I designed has multiple functions and can be configured for either 12 inputs / 12 outputs or 6 of each, hence a 12 channel combo board, with 'on board' pull up resistor SIL networks and driver resistor positions, reset circuits and Tx/Rx comms, which fortunately allowed the function of the RA4 circuit to be implemented 'as though it was designed that way' ... so there are no links, mods to the board etc. Pommie, I did try your suggestion, but did'nt expect it to work, which it did'nt. I think the reason is that when the system is first powered, the RA4 output is high impedence, and hence the LED (and its resistor/anode junction) are 'HIGH' so the LED is ON, there is an inherent delay in the PIC starting up (even without the programmed 72ms start up delay). Hence you do get thes short 'ON' time until the PIC initialises. As Nigel indicated, I have been doing this for years with Micros especialy using transistors/switches to discharge capacitors on Micro Reset circuits before we had WDT chips available. Thanks for all your posts .... Roy |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| RF remote control power drain | johnsmith123 | General Electronics Chat | 9 | 27th December 2007 03:35 AM |
| open collector | jcaluma | General Electronics Chat | 1 | 6th May 2004 10:16 PM |
| The difference in open-drain and push-pull | elarson | General Electronics Chat | 4 | 3rd January 2004 09:38 AM |
| open collector | blibala | General Electronics Chat | 9 | 4th December 2003 10:23 PM |
| Measuring Drain of a FET... | Promocom | General Electronics Chat | 6 | 10th October 2003 03:37 PM |