Log in

View Full Version : Control de puertos PIC16F877A / Port Control PIC16F877A



martintorres
- 24th August 2012, 02:49
Hi Friend´s ... I have a question, or rather, I'm about to start, but I was not drinking any idea comes to mind.
How could I do to control a pic 16F877A, all ports together, as read from an analog signal?
For example, controlling the port B according bitwise analog reading is simple, but ... As could control all ports at once to build a simple LED bar?
I know that I can implement a log shifter, but my idea is to make hardware and I have in mind to build a LED tachometer, where I have thought about implementing a LM3914 at the entrance ... The other way I have thought of doing, is directly implementing a pulse counting. As old and new vehicles are just differ in the way they could acquire the data of the amount of rpm, it occurred to me first ask how I can control all ports at once ... Now I have something armed with a comparative table and Interrupted TMR, But I control only 8 ports ... Any idea? could anyone help?
As soon as you have finished this part, I will arm a little tutorial to explain how they work cycles of a 4-stroke engine, and are based on how to display the RPM tachometers ...
thank you very much



Saludos Amigos... Tengo una duda o mejor dicho, estoy por arrancar, pero no se me viene ninguna idea potable a la cabeza.
Como podria hacer para controlar en un pic 16F877A, todos los puertos en conjunto, segun la lectura de una señal analoga?
Por ejemplo, controlar el puerto B bit a bit segun la lectura analoga es sencillo, pero... Como podria controlar todos los puertos a la vez para poder armar una simple barra de led? Ya se que puedo implementar un desplazador de registro, pero mi idea es hacerlo por hardware ya que tengo en mente armar un tacometro a led, donde tengo pensado implementar un LM3914 a la entrada...La otra manera que tengo pensado de hacerlo, es directamente implementando un conteo de pulsos. Como los vehiculos viejos y nuevos se difieren justamente en la manera en que podria adquirir el dato de las cantidad de rpm, se me ocurrio primero preguntar como puedo controlar todos los puertos a la vez... Ya tengo algo armado con una tabla comparativa y una interrupcion por TMR; Pero solo controlo 8 puertos... Alguna idea? alguien podria ayudarme? Ni bien tenga esta parte terminada, les armare un pequeño tutorial para explicarles como funcionan los ciclos de un motor 4 tiempos, y en como se basan los tacometros para mostrar las RPM...Muchas gracias

mackrackit
- 24th August 2012, 05:33
Not sure I understand what you want but this might be close.
http://www.picbasic.co.uk/forum/showthread.php?t=9037

martintorres
- 24th August 2012, 06:27
mmmm, not ... Sorry for not being very clear ... Look, what I do is similar to the tachometer:

6646

The first design tachometer, just went with 7-segment display and visualilzacion not good ... Now I would like to do it with a LED bar very similar to photo.
regards friend

martintorres
- 24th August 2012, 06:38
aaaaaaaaaa but archangel opened my eyes a little file that rose ( machine tach.txt) ... What I'm going to study a little to see if it is what I play and commented glance

mackrackit
- 24th August 2012, 06:40
Ok, what about shift registers?
http://www.picbasic.co.uk/forum/showthread.php?t=10200

martintorres
- 24th August 2012, 19:06
good topic to which I recommend, I'll consider. It crossed my mind the idea of implementing a shift registers, but as I take all the 16F877, and reduce the hardware, I happened to see a way to control all software ports.
I understand that tastes often bring difficulties, lol, but in this case, is also a question of space.
regards friend

Wilton55
- 2nd October 2013, 12:46
I think Within the PIC, you can choose which byte of the ASCII table to recognize an action when it detects one.

Archangel
- 2nd October 2013, 17:54
aaaaaaaaaa but archangel opened my eyes a little file that rose ( machine tach.txt) ... What I'm going to study a little to see if it is what I play and commented glance
I wouldn't put too much on what you found in my machine tac, it's too slow for automotive I think, you would want a timer bases counter, given the sample rate of an auto ignition. As far as the question you asked : PortB = %11111111 should set all PortB to high state. I prefer binary as I do not get confused, you could use decimal or hex as well i e . . . portb = FF or portB = 255 .
If you use the LM3914 as you mentioned you will have an analog tach with a digital display, with all the advantages and disadvantages of both.

AvionicsMaster1
- 3rd October 2013, 19:35
If using hex don't you need the $ sign? For example Portb = $FF

Archangel
- 4th October 2013, 03:49
If using hex don't you need the $ sign? For example Portb = $FF
Yup, oversight, my bad. $FF