Home
AN5122, Using Freescale`s LIN Driver with the MagniV Family
Contents
1. e _sys_init void Performs the initialization of the LIN core timer initialization The call to the _sys_init is the first call a user must use in the LIN core before using any other API functions e ifc_init l_ifc_handle 111 Initializes the controller specified by the name 111 network name specified in the NPF file 1 e sets up internal functions such as the baud rate The default schedule set by the _ifc_init call will be the L_NULL_SCHEDULE where no frames will be sent and received This is the first call a user must perform before using any other interface related LIN API functions Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 14 Freescale Semiconductor For a slave node this is the end of the initialization process for the LIN network Besides this it might be necessary to initialize other modules for other applications but this relies entirely on the application therefore it is not covered in this application note The last point is to enable the interrupts this can be done with the command EnableInterrupts For a master node a last step 1s required the schedule table to be followed must be selected and a routine must be initialized to follow such schedule a timer set as output compare is commonly used for this purpose The following routines must be called e sch_set lifc_handle iii 1 schedule_handle schedule_111 l_u8 entry tii is the interface name network name specifie
2. Signal configuration The defined signals for this example can be seen in Figure 12 Signal definition z Name Size Type Publisher Subscriber s Init val status 2 Scalar S12VR 12ZVM 0 up_down 2 Scalar 12ZVM S12VR 0 error 1 Scalar S12VR 12ZVM 0 Figure 12 Signals In this example only unconditional frames are being used nevertheless the GUI 1s capable of generating all the frame types specified by the LIN consortium i e unconditional Frame event triggered frames sporadic frames and diagnostic frames As for the signal definition to define an unconditional frame the 9 button must be pressed and the following window must be configured See Figure 13 as a reference Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 7 gt New unconditional frame xs New unconditional frame Name J window_status PID fe 30 Publisher S12VR Size 1 x byte Available Available signal s status a Offset 0 S Contain signal s x gt a Name Size Offset Cancel Figure 1 3 Unconditional frame definition In this example two unconditional frames are defined one for the status of the window and another for the up and down command PIDs are being chosen randomly Unconditional frame definition Name Published by Size Signal s window _ status 30 512VR 1 status error up_down_command 5
3. amp Tm Off All other product or service names are the property of their respective owners Freescale Semiconductor Inc 2015 All rights reserved Document Number AN5122 Rev 0 e 2 freescale semiconductor
4. Creating a new project in CodeWarrior Click Next gt select the name of the project and click Finish Right click the project Folder select New gt Other as in Figure 6 File Name Build New gt Makefile Project with Existing Code gt bZ LDF Example gt LDF Bample O O Eug Fs Project pcs ace Wain amp Source Folder C Folder Copy Ctrl C amp Source File Paste Ctrl V Di Header File X Delete File from Template Move C3 Class Rename F3 Other Ctrl N Imnnart Figure 6 Creating LDF and NPFs files Click on LIN Node Configuration Files select LDF file name the file and click Finish See Figure 7 for reference type filter text 4 amp LIN Node Configuration Files 4 LDF file vex LGN file waz NPF GPIO wc NPF SCI multi interface d NPF SCI single interface wiz NPF SLIC ic Old NPF GPIO wee Old NPF SCI multi interface Wik Old NPF SCI single interface wiz Old NPF SLIC Show All Wizards Figure 7 Figure 1 Creating LDF and NPFs files Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 5 Follow the procedure for the creation of a LDF file but select NPF SCI single interface this file must be chosen since MagniV devices have the LIN physical layer routed to a SCI channel name the file and click Finish Two different instances of this file must be creat
5. In this application note a simple LIN application is developed where a S12ZVM Evaluation Board is being used as master and a S12VR64 Evaluation Board is used as a slave Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 2 Freescale Semiconductor WEITE hardware modules Initialize LIN Network Up button 0 Up button 1 amp amp Down button 0 Buttons Down button 1 pressed Switch 3 0 Send Send Send up signal Go to sleep down signal Figure 2 Application flow diagram Figure 2 features an overview of the application flow diagram The S12ZVM board reads the state of the buttons and based on them sends the corresponding signals to the S12VR64 board to activate a relay thus simulating the control of a DC motor In the following sections we will see how to initialize the LIN Network using Freescale s LIN driver and how to setup MagniV hardware to work in conjunction with Freescale s LIN driver 4 Node configuration tool The node configuration tool allows the user to generate in a straightforward manner the c files that describe the network architecture signals and schedule for the network to follow The node configuration tool takes as inputs a LIN Description File LDF and a Node Private File NPF and outputs the necessary c files for a node to integrate into the network The LDF file describes the network architecture master and slaves the signals that each node publish
6. NAD specifies the diagnostic address this is used in the automatic conflict resolving procedure as well as in diagnostic and configuration functions to identify the node For this reason it is a unique number within the cluster The product ID is a mandatory part of the node configuration it consists of the supplier ID the function ID and the variant ID The response error identifies the signal name used for LIN error reporting and must be defined in the signal section The time value P2 min defines the minimum time for a slave to prepare its response to a master request frame and its default value is 50 ms refer to the LIN specification package for details The ST min time defines the minimum time between two slave response frames and its default value is 0 ms The N_As_timeout defines the maximum time for transmission of a master request frame on the transmitter side and its default value is 1000 ms The supplier ID is assigned by the LIN consortium For Freescale it is OxOOOB 11 The function ID is assigned by the supplier in this case 0x0020 18 was chosen The variant ID must be changed whenever the product is changed but with an unaltered function Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 9 The N_Cr_timeout defines the maximum time until reception of the next consecutive frame and its default value is 1000 ms refer to the LIN specification package fo
7. physical layer of your MagniV device in this case SCI channel 0 is routed to the LIN physical layer of both S12ZVM and S12VR devices The new configured hardware is shown in Figure 18 Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 11 r New network x Name S u0 LDF file LDF_example idf z Node name S12ZVM x Device scio x Cancel Figure 19 Network configuration Name the new network select the corresponding LDF file name of the node and the previously defined hardware device and click Ok The new configured network is shown in Figure 19 The file must be verified by pressing amp button in your CodeWarrior environment and a window must pop up with the following message This NPF form is correct To generate the c files for this node click on A window will prompt for the output folder select it and click OK Figure 20 shows the selected folder for this application ya Choose output folder Process success Please choose container to write output files Output folder LDF_Example lin_exarnple_master_ctg E Overwrite output files Figure 20 NCF generate files A new folder must be created and the following text must appear in the console Generate completed Output files already written in folder Selected_folder The same procedure must be followed for the slave node but in this case the A
8. 127VM 1 up_down Figure 14 Unconditional frames definition As can be seen in Figure 14 the S12VR node has two signals associated with its frame these signals must be added with an offset so that they do not overlap e g status offset 0 size of 2 bits error offset of 2 bits to place it after the status signal Since the other frames will remain unused in this example these can be left unchanged The same procedure as in the unconditional frame could be followed in order to configure the remaining frames if required To configure the Node attribute definition section the 8 button must be pressed and the pop up window must be set as in Figure 15 Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 8 Freescale Semiconductor Edit node attribute 12VR X Edit node attribute S12VR Name S12VR Configured NAD 10 Protocol version 2 1 Initial NAD 10 Product ID Fault state signals Supplier ID 11 Function ID 18 Variant 1 Response error error P2 min 50 0 ms N_As timeout 1000 0 ms ST min 0 0 ms N_Cr timeout 1000 0 ms Configurable frames Available frames x Frame name PID Message ID window_status 30 up_down_command 13 Ok Cancel Figure 15 Node attribute configuration The configured Node Address NAD and initial NAD have been chosen randomly as is up to the designer to choose its value The configured
9. 83 Woleama crraan Figure 8 Configuring the LDF file Select the protocol version and speed for the application as in Figure 9 Global definition Protocol version 21s Language version 2 1 kd Speed la 9 6 kbps Figure 9 Configuring the LDF file In the Node definition section name the master device set the time base usually between 5 ms and 10 ms LIN specification for details and jitter Click on the 9 button to add a slave node a pop up window will appear prompting for the name of the slave See Figure 10 for reference Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 6 Freescale Semiconductor Master Slaves Name 12 VM Time base F 5 0 ms Jitter lied 0 1 ms 48 40 Figure 10 Configuring the LDF file Move on to the Signal definition section in this example three signals are defined e status Holds the status of the window e up_down Holds the command for the slave node controlling the window e error Error signal used required by the slave To add these signals the 8 button must be pressed a pop up window will appear and it must be configured as in Figure 1 with respect to the required signal properties New signal New signal Name status Publisher S12VR a Type Subscriber s Scalar O Array Available Size 2 a bit Initial value E 0 512ZVM Current Figure 11
10. Freescale Semiconductor Inc Application Note Document Number AN5122 Rev 0 04 2015 Using Freescale s LIN Driver with the MagniV Family by Manuel Rodriguez 1 Introduction The S12 MagniV family targets the design of the smallest LIN nodes for both automotive and industrial applications providing a highly integrated and highly reliable solution In order to decrease the development time of applications Freescale provides a LIN 2 x SAE J2602 compliant driver for its devices This document is intended to provide an introduction to Freescale s LIN driver The target audience 1s expected to have some experience with the LIN communication protocol for a deeper treatise of the LIN communication protocol or the driver For further details refer to the LIN specification document or the LIN driver manual This application note will rely on a hands on example to get the LIN driver up and running Freescale Semiconductor Inc 2015 All rights reserved KL WwW N Contents EAC a PERTIS IEE EA E E T PORE Tan OYn EW cancisiiinoni BU OYEN E V saa Node configuration tool ga voice see cinicasneoeiinaveboninenesctineieeens 4 1 LDP Tile and NPP Tle Creat sicesscciinsisavesnorcanes 4 2 LDF Tile configuratii vrissaisatecenstiicccanesaecansaseats 4 3 NPF file 0 AO sca sncssinesancercsetmeusaowmacvernes System MAANA eissien gee API overall USOT cn pateroincdetatiayeransdcetetidinotvedeiinn 6 1 Reading and writing a signa
11. PF file for the node that will be configured to open it then select the GUI editor A warning will appear and the GUI editor will be shown Select the Global definition section to configure it Global definition MCU name MC9S12ZVML128 Idle timeout fel 4 5 BUS clock B000000 Hz Diagnostic class a Autobaud support Figure 17 NPF file configuration Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 10 Freescale Semiconductor Select the device that corresponds with the node In this case the master node is an SI2ZVML128 with a bus clock frequency of 8 MHz The idle timeout will send the bus to sleep after this time has elapsed The minimum time for this is 4 s and the maximum is 10 s as per the LIN specification Autobaud support must not be selected in the master node In this case diagnostic class 1 has been chosen for the application The diagnostic class must be selected with respect to the node function as per the node LIN specification the following are the description of each diagnostic class e Diagnostic class 1 Smart and simple devices like intelligent sensors and actuators requiring none or very low amount of diagnostic functionality Actuator control sensor reading and fault memory handling is done by the master node using signal carrying frames Therefore specific diagnostic support for these tasks 1s not required Fault indication is always signal based e Diagnostic class 2 S
12. a S12Z Preprocessor v Do Not use MWClincludes Variable a a C C Bulld Settings V Always Search User Paths Build Variables 4 S12Z Disassembler amp Discovery Options Output ENSA amp Input ProjDirPath Project_Headers Logging amp Host Settings 4 Messages Tool Chain Editor Disable User Messages ya Properties for UN_example_master Search User Paths include gt C C General Project References Run Debug Settings 4 12Z Burner 4 Output Configure S Records 3 Input 3 Host a 33 Messages m Search User Paths Recursive E i 7 v Disable User Messages Search UserPathsRecursvely 0 HH General 12Z Linker 4 S12Z Compiler 3 Input 83 Access Paths 3 Warnings 83 Code Generation S Optimization Language Messages 3 General 4 S12Z Assembler S MCUToolsBaseDir S12lisa_Support s12lisac include 4 Output S MCUToolsBaseDir S12lisa_Support sl2lisac src S MCUToolsBaseDir S12lisa_Support s12lisac lib_small Search System Paths include lt gt AA amp 9 amp Configure Listing File Input 4 Language 3 Compatibility Modes 7 Figure 22 Updating access paths Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 13 ya Folder selection mrm Select one or more Workspace Folde
13. cale Semiconductor 17 How to Reach Us Information in this document is provided solely to enable system and software implementers to use Freescale products There are no express or implied copyright Home Page licenses granted hereunder to design or fabricate any integrated circuits based on the freescale com information in this document Web Support Freescale reserves the right to make changes without further notice to any products freescale com support herein Freescale makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Freescale assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters that may be provided in Freescale data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including typicals must be validated for each customer application by customer s technical experts Freescale does not convey any license under its patent rights nor the rights of others Freescale sells products pursuant to standard terms and conditions of sale which can be found at the following address freescale com SalesTermsandConditions Freescale and the Freescale logo are trademarks of Freescale Semiconductor Inc Reg U S Pat
14. d in the NPF file schedule_iii is the name of the schedule table to be followed entry is the entry point for the schedule table the frame to be transmitted at the next tick This routine sets up the next schedule to be followed by the _sch_tick function for a certain interface The new schedule will be activated as soon as the current schedule reaches its next schedule entry point This routine must be called after l_ifc_init e sch_tick _ifc_handle 111 This function follows a schedule When a frame becomes due its transmission 1s initiated When the end of the current schedule is reached this function starts again at the beginning of the schedule This function must be called periodically by the master every time_base this is normally called at the ISR of the configured timer Care must be taken no to use the same timer that the driver uses for the schedule Please see Table for reference or refer to the LIN user manual in the LIN driver package for an updated table Table 1 Channels used ae 2ZVM128 See 2ZVL32 Seen 2ZVHY64 SIARA 2VR64 Once this has been configured the master is ready to be used and the interrupts must be enabled 6 API overall description The LIN API is a network software layer that hides the details of a LIN network configuration e g how signals are mapped into certain frames for a user making an application program for an arbitrary ECU Using Freescale s LIN Drive
15. ed one for the master device and one for slave a NPF file must be created for each node in the network If another device is intended to join the network the corresponding NPF file must be selected with respect to the device peripherals 4 2 LDF file configuration Double click on the LDF file that has been created to open it Then select the GUI editor as in Figure 8 A warning will appear and the GUI editor will be shown CodeWarrior Projects 3 H lt LDF_exampleldf 52 J AF p E ajaj E amp File Name T 3 EREEERER ARAL AERA LEAEEEEAEEE EEE E HERRERA A ARERR EERE EEE File Name Build Description LIN Description file created using Vector s LIN File Editor 4 W LDF_Example Created XX XX XXXX 7 4 LDF_example ldf Author r J j ersion dee NPF_example_master Project Global Definitions LIN_description file LIN_protecol_version 2 1 LIN_language version 2 1 LIN_speed lt baudrate gt kbps baudrate 1 20 End of Global Definitions Nodes Nodes Definition 7 o Master lt master_name gt master node name s Commander 3 lt time base gt ms time base real v Project Creation v Settings lt j Ittery eck IJ jitter real i 5 fd tte re tg Import MCU executable file Fi New MQX Lite project Slaves ry New MQX 4 1 project lt slavel name gt lt slave name gt slave node names rs a v Miscellaneous Text edito GUI editor tg Import project
16. es and subscribes to the schedule tables for the network speed of the network baud rate and version of the protocol to be used The NPF file contains the node name communication channel in use e g SCI UART SLIC clock frequency and port used Every LIN cluster requires one LDF file and one NPF file per node in the network The workflow of the node configuration tool is being depicted in Figure 3 It can be seen how the c files generated by this tool in combination with the LIN driver once compiled yield the required files in a LIN network for each of the supported devices Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 3 Node Configuration Code c and h LIN Driver Code c and h Figure 3 Node configuration tool workflow 4 1 LDF file and NPF file creation The node configuration code can be generated in three ways e Windows command line Eclipse plug in Standalone Graphical User Interface GUI The first two methods require the creation of the LDF and NPFs files by hand in contrast the last option includes an intuitive GUI that aids in the creation of the LDF and NPFs files The Eclipse plug in option has been chosen in this document since it significantly decreases the development time For details of the remaining methods refer to the corresponding user guide in the Freescale LIN driver package To install the Eclipse plug in follow the instruct
17. imilar to a class I slave node but it provides node identification support The extended node identification is normally required by vehicle manufacturers Testers or master nodes use ISO 14229 1 diagnostic services to request the extended node identification information Actuator control sensor reading and fault memory handling is done by the master node using signal carrying frames Therefore specific diagnostic support for these tasks is not required Fault indication is always signal based e Diagnostic class 3 Slave nodes are devices with enhanced application functions typically doing their own local information processing e g function controllers local sensor actuator loops These slave nodes execute tasks beyond the basic sensor actuator functionality and therefore require extended diagnostic support Direct actuator control and raw sensor data is often not exchanged with the master node and therefore not included in signal carrying frames ISO 14229 1 4 diagnostic services for I O control sensor value reading and parameter configuration beyond node configuration are required Onto the next section Hardware definition the 8 button must be pressed and the window that pops up must be configured New hardware Name sci0 Type SCI Channel 0 GPIO SLIC SCI UART Cancel Figure 18 Node hardware configuration Name the new hardware and select the SCI channel that is routed to the LIN
18. ions in the Eclipse user manual chapter 3 1 Plug in Setup contained in the documentation folder of the Freescale LIN driver package A project must be created in order to work with this tool please open CodeWarrior Development Studio and click File gt New gt Project as in Figure 4 C C CodeWarrior Development Studio lt il Edit Source Refactor Search Project MQX Tools ProcessorExpert Run Window Help New Open Path Open File Close Ctrl W Rename F2 Refresh F5 Convert Line Delimiters To Print ue Gs gt Alt Shift N gt Ctrl Shift A RRR R Q Ctrl P ri Linux uClinux Application Project f MQX Lite Project MQX 4 1 Project Bareboard Project Embedded Component Makefile Project with Existing Code Project Source Folder Folder Source File Header File File from Template Class Other Ctrl N Figure 4 Creating a new project in CodeWarrior Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Freescale Semiconductor Click on General and select Project as in Figure 5 New Project Select a wizard lt gt Create a new project resource j Wizards type filter text Bareboard Project Linux uClinux Application Project MQX 4 1 Project MQX Lite Project Wizard 4 General E Project gt amp C C b CodeWarrior amp cvs E Show All Wizards Figure 5
19. is function reads and returns the current values of the selected bytes in the signal The sum of start and count shall never be greater than the length of the byte array To write a scalar signal one of the following functions must be used depending on the type of the signal to be written e bool _bool_wr_sss 1_bool v e us _u8_wr_sss 1_u8 v e ul6 l_ul6_wr_sss l_u16 v Where v is the value to be written to the signal and sss is the signal handle as has been already stated To write an array the following function must be used e _bytes_wr_sss l_u8 start first byte to write to Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 16 Freescale Semiconductor e u8 count number of bytes to write e const l_u8 const data where data is read from Sets the current value of the selected bytes in the signal specified by the name sss to the value specified The sum of start and count shall never be greater than the length of the byte array although the device driver may choose not to enforce this in runtime 6 2 Send Go to sleep command and wake up command To send the Go to sleep command the following function must be called e _ifc_goto_sleep 1_ifc_handle 111 Where 111 is the name of the interface e g l_ifc_goto_sleep LIO This function can be called only by the Master node This call requests slave nodes on the cluster connected to the interface to en
20. l csseeesseseeeees 6 2 Send Go to sleep command and wake up ose ee ee References snk crdcersteitanGicaiacevincuiantiaeraertendidancd einmeinnbies yy freescale 2 MagniV family overview MagniV s increasing portfolio of highly integrated solutions features several microcontrollers aimed to allow the design of the smallest LIN nodes Each of these microcontrollers is build in such a way that it spans the majority of applications that might require a LIN interface such as window lifters sunroof controllers wipers body and control solutions MagniV LIN portfolio has been created to fulfill the requirements of the automotive industry and work in space constrained environments such as those encountered in some automotive applications Figure 1 shows MagniV s LIN portfolio and some of its target applications S 12ZVM Family S12VR Family Efficient and scalable BLDC Relay driven motor and DC motor control applications solution z MagniV LIN portfolio First automotive instrument cluster solution with the most integration in a single chip Mixed Signal MCU for LIN Applications such as sensors actuator switch panels or ambient lights S12ZVL Family 12ZVH Family Figure 1 MagniV Portfolio Figure features MagniV s LIN portfolio to the date of the document MagniV portfolio is constantly changing so for the updated portfolio visit www freescale com magniv 3 Example overview
21. r details chapter 3 2 5 Timing constraints Configurable frames must list all frames unconditional frames event triggered frames and sporadic frames processed by the slave node To move onto the next and last step of the LDF file configuration the Schedule table definition must be selected and the button must be pressed The window in Figure 16 will pop up New schedule table x New schedule table Name window Item type Frame a Schedule table item details Frame window status a Delay Ei ms Ej Schedule table items Command Details Delay ms window_status window_status 10 0 up_down_command up_down_command 10 0 Ok Cancel Figure 16 Schedule table configuration Name the schedule table and select the type of items it will hold In this example the only schedule table that will be used is intended to poll the status of the window and send the up and down command therefore the item type has been selected as frame The frames related to this schedule table must be added and a delay between them must be defined The delay specified for every schedule entry shall be longer than the jitter and the worst case frame transfer time The file must be verified by pressing button in your CodeWarrior environment and a window must pop up with the following message This LDF form is correct 4 3 NPF file configuration Double click on the N
22. r with the MagniV Family Rev 0 04 2015 Freescale Semiconductor 15 Freescale s LIN driver integrates this API and is completely compliant with the LIN specification package This application note only covers functions related with e Reading and writing a signal e Send Go to sleep command and wake up command For a detailed explanation of the available functions refer to the LIN specification package or the FSL_LIN_API_ Documentation webpage included in the LIN driver package FSL_LIN_DRIVER Documentation FSL_LIN_API_ Documentation 6 1 Reading and writing a signal The available signal types are the following e bool For one bit signals zero 1f false non zero otherwise e u8 For signals of the size 2 8 bits e ul6 For signals of the size 9 16 bits To read a scalar signal one of the following functions must be used depending on the type of the signal to be read e bool l_bool_rd_sss void e us _u8_rd_sss void e ul6 _ul6_rd_sss void Where sss is the signal handle which is the name of the network underscore name of the signal therefore if the previously defined signal status must be read this can be achieved by calling the function _u8 amp rd_LIO_statusQ To read an array the following function must be used e _bytes_rd_sss l_u8 start first byte to read from e u8 count number of bytes to read e u8 const data where data will be written Th
23. rs amp Project_Settings 4 amp Sources 4 Drivers amp GPIO MCU 4 UN 4 amp LN_driver 4 amp bsp SCI gt coreapi diagnostic amp include E lowlevel S transport lay lin_example_master_cfg Cancel Figure 23 Add access paths For 12 microcontrollers CodeWarrior Classic IDE simply drag and drop the access paths will be updated automatically To be able to use the LIN driver in your project include the header definition lin h in your document The hardware must be configured accordingly with the NPFs files therefore the clock frequency of each microcontroller has to be adjusted please refer to the reference manual of your device to perform the required clock adjustments The LIN physical layer of the MagniV device must be enabled the name of the registers might vary from device to device but the procedure remains the same at a high level The following pseudo code illustrates the general procedure to enable the LIN physical layer of a MagniV device please refer to the device reference manual SELECT_PULL_UP This is done to strengthen the signal SELECT _ SLEW _ RATE Optimizes the behavior for the selected baudrate ENABLE_PHYSICAL_LAYER Enable LIN physical layer The LIN network must be initialized before trying to initiate communication This is performed by calling the following routines declared in the LIN specification package
24. ter bus sleep mode by issuing one Go to sleep command The Go to sleep command will be scheduled latest when the next schedule entry is due The _ifc_goto_sleep will not affect the power mode It is up to the application to do this If the Go to sleep command was successfully transmitted on the cluster the go to sleep bit will be set in the status register To send the wake up command the following function must be called e _ifc_wake_up 1_ifc_handle 111 Where 111 is the name of the interface e g l_ifc_wake_up LIO This function can be called by the Master node and slave nodes The function will transmit one wake up signal The wake up signal will be transmitted directly when this function 1s called After this function has been called the schedule table to follow must be set with the sch_set function 7 References e LIN Specification Package Rev 2 2 A LIN consortium 2010 www lin subbus org e AN2767 LIN 2 0 Connectivity on Freescale 8 16 bit MCUs Using Volcano LTP Rev 0 Nov 20014 http notes application abcelectronique com 314 314 66253 pdf e Eclipse_User_Manual in the Freescale LIN driver package available in freescale com e LIN_User_Manual in the Freescale LIN driver package available in freescale com e FSL_LIN_API_ Documentation in the Freescale LIN driver package available in freescale com Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 Frees
25. utobaud support can be selected if desired The slave configuration used in this example is being showed in Figure 21 Global definition MCU name MC9S12VR64 Idle timeout el 4 BUS clock 8000000 Hz S Diagnostic class Autobaud support Vv Hardware definition Name Type Channel Timer Channel scid SCI 0 1 Network definition Name LDF file Node Device LIO LDF_example ldf S12VR sci Figure 21 Slave configuration Using Freescale s LIN Driver with the MagniV Family Rev 0 04 2015 12 Freescale Semiconductor To generate the c files for this node click on A window will prompt for the output folder select it and click OK A new folder must be created and the following text must appear in the console Generate completed Output files already written in folder Selected_folder 5 System initialization A new project must be created for each device in the network and the LIN driver sources must be dragged and dropped into each project For S12Z CodeWarrior 10 6 microcontrollers the paths must be added Right click on the project gt properties gt C C Build gt Settings gt S 12Z Compiler gt Access Paths and click on the button in the Search User Paths section Click on Workspace select all the folders of the LIN driver and click ok See Figure 22 and Figure 23 for reference TT lt _ lt Lele J type filter text Settings p vv R a
Download Pdf Manuals
Related Search
Related Contents
組付・取扱説明書 en français en español All-Pro FTR1740L Instructions / Assembly Haier HW70-1401 Copyright © All rights reserved.
Failed to retrieve file