Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 10, 2016, 11:16:30 23:16


Login with username, password and session length


Pages: [1]
Print
Author Topic: 16F877A system control to tachometer (FIS version) on the table  (Read 2606 times)
0 Members and 1 Guest are viewing this topic.
mazoul72
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


« on: October 28, 2011, 11:01:05 23:01 »

Hello,

my project :

FIS control like VAG (home display , VAG-COM like , Soft coding change on the fly ...)

problem : software---> program modification with already based Version 1.0
                                 frame to decode with K-LINE (control bytes sequence already have but have to improve) or BUSCAN (but very hard to decode)

              hardware : ---> 1) problem with outputs RESET/DOWN/UP steering wheel commands
                                     2) to conceive some more functions..

The system is on the "table" but need to modify 3 wires on Green connector (23 / 24 / 25 ) :


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 ??)

Opto-isolator but how plug to RCx 3 wires ??

+12V is normaly on 23/24/25 input ("on the air" wires) --> not lie to external Ground(perhaps internal FIS tachometer...) .
If the soft PIC put +12V (output RCx) on +12V FIS , hardware failure.... so no +12V  force but only Ground with  external input command buttons . 

                                  
« Last Edit: October 28, 2011, 11:09:10 23:09 by mazoul72 » Logged
TomJackson69
V.I.P
Active Member
*****
Offline Offline

Posts: 221

Thank You
-Given: 23
-Receive: 63


« Reply #1 on: October 29, 2011, 01:18:16 01:18 »

Not really understand what you want. Do you want to convert +12V to +5V signal to input to the PIC (pin B5, B6 and B7)?

Be clearer for us to understand what you want.

Tom
Logged

Con Rong Chau Tien
gan_canny
Junior Member
**
 Warned
Offline Offline

Posts: 85

Thank You
-Given: 98
-Receive: 25


« Reply #2 on: October 29, 2011, 02:03:05 14:03 »

The issue is that a PIC is 5v and the input output levels are 12v.
 If the circuit doesn't need isolated grounds.
 On the input side a resistor divider could split the voltage eg 5k 7k. The output needs a level shifter. Here a 74xx hex non-inverting  or inverting ( do the inversion in the MCU) open collector would likely work.
If the circuit  needs isolated grounds.
 If isolation is needed then the opto isolator would work.
Logged
zokij
Senior Member
****
Offline Offline

Posts: 330

Thank You
-Given: 196
-Receive: 617


Nice time :)


« Reply #3 on: November 02, 2011, 02:40:11 02:40 »

not expensive but will reliable to use TLP504A on both side (portb and portc)
Logged
mazoul72
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


« Reply #4 on: November 05, 2011, 03:16:35 15:16 »

Hi,
thanks for aswers .
i put option_reg.7 for pull-up RB5 to RB7 (input steering wheel) and RB0 to RB2 (radio display on FIS tacho) .
I have for it an ASM prog but i've just seen that i didn't put TRISB %11100111 for input RB.
Is it for this mistake i have +6.7V(RB7,RB6) and 4.98V(RB5) : VERY Strange ...
My input PIC Voltage is stable at 4.98V .

Start:

ASM

loop
BTFSS PORTB.5 ; jump next instruction if B.5 = "1"
BCF PORTC.3 ; put C.3 à "0" (B5 input and C3 output)
BTFSC PORTB.5 ; jump next instruction if B.5 = "0"
BSF PORTC.3 ; put C.3 à "1"


BTFSS PORTB.6 ; jump next instruction if B.6 = "1"
BCF PORTC.4 ; put C.4 to "0" (B6 input and C4 ouput)
BTFSC PORTB.6 ; jump next instruction if B.6 = "0"
BSF PORTC.4 ; put C.4 to "1"

;Si aucunes commandes validées alors on continu dans le programme complet
BTFSC PORTB.7 ; jump next instruction if B.7 = 0 (validation)
GoTo loop

ENDASM

mainprog:
action for each command.....on Fis display
if portb.7 = "0" then goto validmenu....
if portb.6 = "0" then menu=menu+1;goto fisdisplay
if portb.5 = "0" then menu=menu-1;goto fisdisplay
goto Start
fisdisplay:
....
...  lineK access
...
validmenu:...
...
...
return
END
Logged
mazoul72
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


« Reply #5 on: November 06, 2011, 05:45:34 17:45 »

PORTB.6 is at 3.5V , not 5V , i don't understand why Huh
PORTB.5 and PORTB.7 is at 5V , very strange ...


Regards
Mazoul72
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 3817

Thank You
-Given: 567
-Receive: 2049


There is no evidence that I muted SoNsIvRi


« Reply #6 on: November 06, 2011, 08:03:16 20:03 »

A schematic might help. How are you getting >> "i have +6.7V(RB7,RB6) and 4.98V(RB5) : VERY Strange ..."
that is not so strange if your feeding 12v into output ports.

if your just driving 12v from the pic, why not use a fet as logic driver.
Logged

Note: If you have no posts other than, I want or reporting a dead link Then you can't complain If I remove your post So Stop Leeching
mazoul72
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


« Reply #7 on: November 07, 2011, 12:54:29 00:54 »

It is strange because all should be at 6.7V with 12V driving .
Without 12V from tachometer, in fact i have 5V on RB7 ,RB5 and on RB6 : 3.5V  .ld
all should be at 5V .
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 3817

Thank You
-Given: 567
-Receive: 2049


There is no evidence that I muted SoNsIvRi


« Reply #8 on: November 07, 2011, 01:43:16 01:43 »

if you have any pin higher than the vcc, then you have a problem, your 12V is leaking into ciruit, thats why request for schematic.
having a pin between > 0 to 5V is what you would see if static, having 3.5V means that pin is pulsing.
High longer than the Low, a pin at 2.5V would be 50%.

16f877 has an operating voltage range (2.0V to 5.5V) 6.7 is a killer for pics.
« Last Edit: November 07, 2011, 01:47:15 01:47 by pickit2 » Logged

Note: If you have no posts other than, I want or reporting a dead link Then you can't complain If I remove your post So Stop Leeching
mazoul72
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


« Reply #9 on: November 10, 2011, 11:54:27 23:54 »

Hello,

my second approach is the K-line protocol

dato = data  of tachometer
ena = enable  " " " " "
clk = clock     " " " " "

Code:

      suma=0
         dat=126
         ShiftOut dato, clk, 5,[dat]
           suma=suma ^ dat
          
         rem High dato
        
         dat=237
         ShiftOut dato, clk, 5,[dat]
          suma=suma ^ dat
          
         rem Low dato
        
         dat=15
         ShiftOut dato, clk, 5,[dat]
          suma=suma ^ dat
        
         rem High dato
      
           For cont=0 TO 15        (DATA caracters in PIC EPROM )
           tmp=msg[cont]
            rem dat=255 - tmp
             dat= ~ tmp
             suma=suma ^ dat
        
            ShiftOut dato, clk, 5,[dat]
           rem Low dato
        
         Next cont
        
          
            dat=suma + 1
            ShiftOut dato, clk, 5,[dat]
           rem  Low dato
        
        
            High ena
            
The problem is the data logging .
i have a log file but i don't know what is the difference between each value .
« Last Edit: November 10, 2011, 11:56:55 23:56 by mazoul72 » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC