Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LIN connectivity

Status
Not open for further replies.

aladdin83

New Member
Hi all,,

I am using a PIC16F877A microcontroller and I am using both of the PWM/Capture/Compare pins to send out a PWM signal.

To continue working on the project I need to measure speed which can be done using Capture command but since I am out of Capture/Compare pins I am thinking about adding another microcontroller chip like PIC12F for example.

does anyone have an idea on how to connect the two chips together to make the PIC16F my master ucontroller and the PIC12F my slave ucontroller.

I read in the microchip website that there is protocol called LIN but I didnt find much info on how to start, how to connect or how to program the two PICs

so if anyone have any resources or advice regarding the LIN connectivity I would really appreciate your help

thank you
 
You might be able to measure speed with the timers. You could count using timer 0 and use timer 1 as the timebase.

Mike.
 
i see

when i was looking at the manual, i thought i cant use timer 0 and timer 1,,

how do i write the code for it ?

That depends on the pulse rate from the encoder. If it's slow (100/S) then you use timer 1 to time each pulse. If faster then you clock timer 0 with it and use timer 1 to produce a (eg) 10mS interrupt to process timer 0 counts.

Mike.
 
Check my tutorials which show how to do RS232 - you don't need MAX232's between PIC's, just pin to pin.

thanks for the website, but i didnt understand how to use the RS232 between the microcontrollers

i found away using I2C interface which doesn't require any additional IC for the interface and I think it's supported by the PIC16F877A that I'm using
 
That depends on the pulse rate from the encoder. If it's slow (100/S) then you use timer 1 to time each pulse. If faster then you clock timer 0 with it and use timer 1 to produce a (eg) 10mS interrupt to process timer 0 counts.

Mike.

Thanks, I didnt know that I can use these timers,, I will read more about the timers and see if it works, if not I will use two ucontroller IC's

Thanks again
 
thanks for the website, but i didnt understand how to use the RS232 between the microcontrollers

i found away using I2C interface which doesn't require any additional IC for the interface and I think it's supported by the PIC16F877A that I'm using

So you can't figure out simple RS232, yet you can complicated I2C?.

All you do for serial between PIC's is connect TX to RX, RX to TX, and the grounds together (which would be anyway).
 
So you can't figure out simple RS232, yet you can complicated I2C?.

All you do for serial between PIC's is connect TX to RX, RX to TX, and the grounds together (which would be anyway).

it's not that I can't figure out a simple RS232..
it's just that I havent worked with PICs before starting this project and I've been using PIC BASIC Pro compiler and the codes are different from what you are using in your tutorial and the manual for the pic plus the compilers manual are more clear to me...

thanks anyway,
 
Status
Not open for further replies.

Latest threads

Back
Top