![]() |
![]() |
![]() |
|
|
|||||||
| 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) |
|
I am plannint to turn on 3 leds of 2.1v@15mA by using 3 pins from any port of the micro (AB or C)
Does any pin from the pic16F870 can support that leds. I will use a resistor of 330ohm in series with the output of the pin and in serie with the led, the led will end at GND. the manual says source sink 25mA, I think it can support my leds, but one or all leds? what does high sink mean? Does anyone know a tutorial where I can see EXAMPLES of how to initialize timers and interrupts and how to use them. I have already read tutorials but i need examples. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
The hardware extras sections also explains 'sink' and 'source', with the LED to GND the PIC is working in 'source' mode - with current coming out of the PIC to the LED. One of the tutorials also uses a timer and interrupts to multiplex a double seven segment LED display. |
||
|
|
|
|
|
(permalink) |
|
Nigel
the pull-ups resistors, what advatages can gave me? because they are automatically disable when the port is configured as output, but when the port is configured as input? I know that it is software configurable. The open drain collector, means that i should put an external resistor, what value is recommended? if I use this open drain collector pin does the input signal I read is inverted or is as it is; 5v = logic 1, 0v = logic 0 thanks |
|
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
(permalink) |
|
What is the inpedance of any pin port when they are configured as inputs?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
I did an "AND GATE" with two diodes 1N4148, I will connect two push buttons that when any of two is closed will produce an 0 logic, al least.
so this two signals will control the MCLR#, if the two push buttons are normally open as they are then I will have 5 volts, so the reset will be desactivated, if some of the are pressed then the reset is generated. Hope this is a high impedance, more that 1 Megaohm, because if not, the voltage will drop and I'll never will see any accion thank you, Nigel |
|
|
|
|
|
|
(permalink) |
|
You don't need the diodes, Just use 1 pullup resistor on mclr (10K or something), and connect both switches between mclr and ground.
Pressing eighter one will pull mclr low. |
|
|
|
|
|
|
(permalink) |
|
Great Idea
I do not believe it, it is a great idea, I was thinking on something robust, because one push button is for a local reset near the uC, and the other one is for a push button is for a remote reset, it will be at a distance of 30 meter. what do you think about glitches |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
ok, that changes all, the second SW (S2), will be controlled by a relay, I will look for one, if I have one DC relay, it just is fed to for example +5v to gnd, isn' it?.
another question Is it possible to read and write of the same port at the same time, I mean if I put a 0 or a 1 in PTOB.1 at the same time I can read PTOB.8? |
|
|
|
|
|
|
(permalink) |
|
i believe that writing to the port , actually reads the port then writes to port.
i read that somewhere.. the pic does a read before write , on every write .. hope this helps |
|
|
|
|
|
|
(permalink) |
|
thanks I hope what you say be true, because if not it will be painful
(i think because many bcf, bsf to write just one bit, while btfsc and btfss will read just one bit, however this instruccions force me to jump). The PIC 16F870 has two Vss, I use one for the oscillator, and the other for the circuits or it really does not matther.? |
|
|
|
|
|
|
(permalink) | ||
|
Quote:
A lot depends what you are trying to do. Quote:
|
|||
|
|
|
|
|
(permalink) |
|
Thanks a lot, The tutorials you have in the site are pretty good,
do you have any example of timers? I am using the 16F870 Does TIMER0 can be reprogrammed by the user? I have a dip switch of 4 positions, 3 of them will be used to define by hardware the correspnding TIME DELAY 20 ms................111 100 ms..............110 300 ms..............101 200 ms..............100 1000 ms............011 the other 3 possible positions will not be taken into account. I'll use it to start a time delay when an event is presented at RB0/INT and if I have 111, then I know that I will wait just 20ms and if the event persists then I have to stop the system. And if before an event occurred and have passed 30 minutes, then I will clean my registers where events are counted. How it can be possible? I still can't imagine!, does timer0 and timer1 and even timer2 can work simultaneusly without delaying the other process of the microcontroler, as delays do |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|