CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

CCS and LIN bus

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

CCS and LIN bus
PostPosted: Fri May 01, 2009 6:29 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri May 01, 2009 7:35 pm     Reply with quote

An EUSART has the ability to send a Break character. The normal USART
does not. There may be other reasons why CCS wants an EUSART for
the Lin Bus.

Look at the Lin Bus page on Microchip for other answers:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2143&param=en023249&section=2

Search the Microchip forums for: Lin bus
http://www.microchip.com/forums/search.aspx
There is no specific forum for the Lin Bus, so the answers will be found
in a variety of forums (CAN forum, USART forum, etc.).
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

PostPosted: Sun May 03, 2009 2:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun May 03, 2009 5:14 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 04, 2009 8:16 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group