View previous topic :: View next topic |
Author |
Message |
meereck
Joined: 09 Nov 2006 Posts: 173
|
CCS and LIN bus |
Posted: Fri May 01, 2009 6:29 am |
|
|
Hello everybody,
I am a bit confused about LIN bus node (both master and slave) implementation with PIC18.
In the compiler LIN examples, there is the following "The program may be modified to work with other PIC chips that have EUSART module".
I have several question regarding the LIN bus:
1) do I need a PIC18 with EUSART feature?
2) do I need a LIN bus driver such as MCP201 or MC2021 - or I only need the driver when I want to use a PIC without EASART?
I have searched the forum but no helpful threads appeared.
Thanks in advance for clarification.
M. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
Posted: Sun May 03, 2009 2:05 am |
|
|
thanks for the reply,
the problem is the CCS driver for LIN is written for normal USART only (at least what I understand).
I would like to use a PIC with EUSART, and therefore I am looking for some examples how to set the EUSART to work with LIN bus. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun May 03, 2009 5:14 pm |
|
|
Quote: | the problem is the CCS driver for LIN is written for normal USART only |
That's not true. The CCS drivers and examples are written for PICs
with an EUSART. The 16F PICs used by the driver have an EUSART:
Here are the driver and example files:
Quote: | c:\program files\picc\examples\ex_linbus_master.c
c:\program files\picc\examples\ex_linbus_slave.c
c:\program files\picc\drivers\linbus.h |
Here are the comments at the top of the files:
Quote: |
// This example works with the LIN_BUS.h driver. The Master is a
// 16F687/689/690 chip.
// The slave is a 16F687/689/690 chip.
// Prototypes, definitions, and defines used for
// the CCS LIN BUS library for PIC16F687/689/690
|
From the 16F690 data sheet:
Code: |
Device EUSART
PIC16F687 Yes
PIC16F689 Yes
PIC16F690 Yes
|
|
|
|
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
Posted: Mon May 04, 2009 8:16 am |
|
|
Oh, you are right, I get it now.
I finally understand the sentences:
"
This example works with the LIN_BUS.h driver. The Master is a 16F687/689/690 chip. The program may be modified to work with other PIC chips that have EUSART module
"
It is just because the linbus.h driver contains #bit and #byte definitions for 16F687/689/690 registers. That is the only reason that the driver depends on those PIC models.
Thanks for clarifying,
it is solved now.
meereck |
|
|
|