PDA

View Full Version : 16F877A system and tachometer (FIS version) on the table



mazoul72
- 28th October 2011, 15:43
Hello,

i have a system with a PIC16F877A that is in serial with steering wheel command (RESET / UP / DOWN on B5,B6 et B7)
I am programing to put ground on outputs (RC3 ,RC4 ,RC5 ) but for valid UP/DW/RESET i need transistion from +12V to ground .

Also i need absolutely 12V like FIS send to input (normally) and PIC has only +5V to 3 wires .
How have +12V on RC3 ,RC4 and RC5 outputs command by my program ? (pull-up resistors ??)

Regards.60896090

aratti
- 28th October 2011, 16:07
Simply use optoisolators.

Al.

mazoul72
- 28th October 2011, 17:30
I will have +5v on isolator inputs and +12v on output ?

mazoul72
- 28th October 2011, 18:22
I have
Input pulsup (B5,B6,B7)
Input pulsdw
Input pulsres
and
Output mup (C3,C4,C5)
Output mdw
Output mres
High mup
High mdw
High mres

But it is the problem of 5V , no +12V . I don't understand ,+12V (output FIS) to +5V (output PIC) , it is a BIG problem ??

6091

mazoul72
- 28th October 2011, 21:49
My program works like this :

a detection for RBx cause a different display to FIS Tachometer and for input isolator (output RC5,6,7) cause a +5V and +12V on output isolator .
BUT it is dangerous because a +12V on output isolator cause a failure on FIS tacho input voltage .
I would like only a No intrusive +12V but GROUND ONLY (action with ground input RBx) .
FIS give +12V in normal operation :

6093

aratti
- 28th October 2011, 21:56
If your FIS tacho device doesn,t requires too much current at the inputs the opto is the solution ( remember that the signal is inverted. in other words when pic pin is low the output is high) I have separated the two grounds, but they can be common.

If on the other hand you will require more current at the input then use the second solution which uses two transistors.


Cheers

Al.

mazoul72
- 28th October 2011, 22:40
i put today +12V directly on FIS Tacho input , with harware power failure ...
What is the difference with +12V (10Kohms resistor) ??

Thanks for your answer ...

mazoul72
- 28th October 2011, 23:03
the 3 pins 23 / 24 / 25 on the FIS tacho.. are "on the fly" with 12V voltage .
Perhaps , with my 12V transformer (12V/300mA) , the inputs required more than 300mA that caused a power failure....

aratti
- 28th October 2011, 23:04
Can you post the data sheet of your tacho device?

Al.

mazoul72
- 28th October 2011, 23:43
How find it ?

it is a 1J5 920 846 C from golf4 .

mazoul72
- 31st October 2011, 22:10
If i put transistor directly to FIS without the +12V and 10Kohms resistors , i can have 12V from FIS (low level on PIC pin) and ground when transistor is "excited" .

aratti
- 2nd November 2011, 04:45
Your FIS device has internal pullups, so you don't need the external one.

Cheers

Al.

mazoul72
- 3rd November 2011, 14:09
Hello,

i have already put OPTION_REG for pull-up resistors on port B but it is strange :

on RB5 , RB7 i have 6.7 Volts and on RB6 i have 4.98V
My voltage regulator provide 5V and 12V on transformator (Stable)
I don't understand why .

i have an ASM routine for UP/DW/Reset detection .
it doesn't work well .

Start:

ASM

loop
BTFSS PORTB.5 ; on saute instruction suivante si B.5 = "1"
BCF PORTC.3 ; on passe C.3 à "0"
BTFSC PORTB.5 ; on saute instruction suivante si B.5 = "0"
BSF PORTC.3 ; on passe C.3 à "1"


BTFSS PORTB.6 ; on saute instruction suivante si B.6 = "1"
BCF PORTC.4 ; on passe C.4 à "0"
BTFSC PORTB.6 ; on saute instruction suivante si B.6 = "0"
BSF PORTC.4 ; on passe C.4 à "1"

;Si aucunes commandes validées alors on continu dans le programme complet
BTFSC PORTB.7 ; on saute instruction suivante si B.7 = 0 (validée)
GoTo loop

ENDASM

mainprog:
action for each command.....on Fis display
....
...
goto Start
END

Regards
Mazoul72

mazoul72
- 3rd November 2011, 22:38
I've just seen that TRISB miss for input PORTB

Is this mistake provide bad functionnal reactions ?

OPTION_REG7=0
TRISB = %11100111 (RB5 to RB7-->steering wheel button detection , RB0 to RB2-->radio display input ENA/CLK/DATA) with internal pull-up .