Infineon-Component - Vector - CAN - V1.10-Software Module Datasheets-V01 - 01-EN
Infineon-Component - Vector - CAN - V1.10-Software Module Datasheets-V01 - 01-EN
The document following this cover page is marked as “Cypress” document as this is the
company that originally developed the product. Please note that Infineon will continue
to offer the product to new and existing customers as part of the Infineon product
portfolio.
www.infineon.com
PSoC® Creator™ Component Datasheet
Vector CAN
1.10
Features
▪ CAN2.0 A/B protocol implementation, ISO 11898-1 compliant
▪ Programmable bit rate up to 1 Mbps
▪ Two or three wire interface to external transceiver (Tx, Rx, and Tx
Enable)
General Description
The Vector CANbedded environment consists of a number of adaptive source code components
that cover the basic communication and diagnostic requirements in automotive applications.
The Vector CANbedded software suite is customer specific and its operation will vary according
to application and OEM. This component for the Vector CANbedded suite is written to generically
support the CANbedded structure regardless of the flavor of the particular OEM application.
The Vector CAN component developed for PSoC3 allows easy integration of the Vector certified
CAN driver.
Input/Output Connections
This section describes the various input and output connections for the Vector CAN component.
An asterisk (*) in the list of I/Os indicates that the I/O may be hidden on the symbol under the
conditions listed in the description of that I/O.
rx – Input
CAN bus receive signal (connected to CAN RX bus of external transceiver).
Cypress Semiconductor Corporation • 198 Champion Court • San Jose, CA 95134-1709 • 408-943-2600
Document Number: 001-85031 Rev. *E Revised December 14, 2017
Vector CAN PSoC® Creator™ Component Datasheet
tx – Output
CAN bus transmit signal, (connected to CAN TX bus of external transceiver).
tx_en – Output *
External transceiver enable signal. This output displays when the Add Transceiver Enable
Signal option is selected in the Configure dialog.
Component Parameters
Drag a Vector CAN component onto your design and double click it to open the Configure
dialog. This dialog has a General tab to guide you through the process of setting up the Vector
CAN component.
Enable Interrupts
Enables/disables global interrupts from the CAN. The default setting is Enable. Should be
disabled if the driver files are configured for polling mode (otherwise compilation errors appear).
Clock Selection
The Vector CAN component is connected to the BUS_CLK clock signal. A minimum value of
10 MHz is required to support all standard CAN baud rates up to 1 Mbps. The value of the
BUS_CLK selected in the PSoC 3 project design-wide resources must be the same as the value
selected in the Vector CAN driver configuration for bus timing.
Functions
Function Description
Vector_CAN_Start() Initializes and enables the Vector CAN component using the
Vector_CAN_Init() and Vector_CAN_Enable() functions.
Vector_CAN_Stop() Disables the Vector CAN component.
Vector_CAN_GlobalIntEnable() Enables Global Interrupts from CAN Core.
Vector_CAN_GlobalIntDisable() Disables Global Interrupts from CAN Core.
Vector_CAN_Sleep() Prepares the component for sleep.
Vector_CAN_Wakeup() Restores the component to the state when Vector_CAN_Sleep() was called.
Vector_CAN_Init() Initializes the Vector CAN component based on settings in the component
customizer. Sets up the CAN interrupt with the interrupt service routine
CanIsr_0() generated by the Vector CAN configuration tool.
Vector_CAN_Enable() Enables the Vector CAN component.
Vector_CAN_SaveConfig() Saves the component configuration.
Vector_CAN_RestoreConfig() Restores the component configuration.
uint8 Vector_CAN_Start(void)
Description: This is the preferred method to begin component operation. Vector_CAN_Start() sets the
initVar variable, calls the Vector_CAN_Init() function, and then calls the
Vector_CAN_Enable() function.
Parameters: None
Return Value: Indication whether register is written and verified.
Value Description
CYRET_SUCCESS Function passed successfully.
Vector_CAN_FAIL Function failed.
Side Effects: None
uint8 Vector_CAN_Stop(void)
Description: Disables the Vector CAN component.
Parameters: None
Return Value: Indication whether register is written and verified.
Value Description
CYRET_SUCCESS Function passed successfully.
Vector_CAN_FAIL Function failed.
Side Effects: None
uint8 Vector_CAN_GlobalIntEnable(void)
Description: This function enables global interrupts from the CAN Core.
Parameters: None
Return Value: Indication whether register is written and verified.
Value Description
CYRET_SUCCESS Function passed successfully.
Vector_CAN_FAIL Function failed.
Side Effects: None
uint8 Vector_CAN_GlobalIntDisable(void)
Description: This function disables global interrupts from the CAN Core.
Parameters: None
Return Value: Indication whether register is written and verified.
Value Description
CYRET_SUCCESS Function passed successfully.
Vector_CAN_FAIL Function failed.
Side Effects: None
void Vector_CAN_Sleep(void)
Description: This is the preferred routine to prepare the component for sleep. The Vector_CAN_Sleep()
routine saves the current component state. Then it calls the Vector_CAN_SaveConfig()
function and calls Vector_CAN_Stop() to save the hardware configuration.
Call the Vector_CAN_Sleep() function before calling the CyPmSleep() or CyPmHibernate()
functions.
Parameters: None
Return Value: None
Side Effects: None
void Vector_CAN_Wakeup(void)
Description: This is the preferred routine to restore the component to the state when
Vector_CAN_Sleep() was called. The Vector_CAN_Wakeup() function calls the
Vector_CAN_RestoreConfig() function to restore the configuration. If the component was
enabled before the Vector_CAN_Sleep() function was called, the Vector_CAN_Wakeup()
function will also re-enable the component.
Parameters: None
Return Value: None
Side Effects: Calling the Vector_CAN_Wakeup() function without first calling the Vector_CAN_Sleep() or
Vector_CAN_SaveConfig() function may produce unexpected behavior.
uint8 Vector_CAN_Enable(void)
Description: Activates the hardware and begins component operation. It is not necessary to call
Vector_CAN_Enable() because the Vector_CAN_Start() routine calls this function, which
is the preferred method to begin component operation.
Parameters: None
void Vector_CAN_SaveConfig(void)
Description: This function saves the component configuration. This will save nonretention registers. This
function will also save the current component parameter values, as defined in the Configure
dialog or as modified by appropriate APIs. This function is called by the
Vector_CAN_Sleep() function.
Parameters: None
Return Value: None
Side Effects: None
void Vector_CAN_RestoreConfig(void)
Description: This function restores the component configuration. This will restore nonretention registers.
This function will also restore the component parameter values to what they were prior to
calling the Vector_CAN_Sleep() function.
Parameters: None
Return Value: None
Side Effects: Calling this function without first calling the Vector_CAN_Sleep() or
Vector_CAN_SaveConfig() function may produce unexpected behavior.
Global Variables
Variable Description
Vector_CAN_initVar Vector_CAN_initVar indicates whether the Vector CAN has been initialized. The variable is
initialized to 0 and set to 1 the first time Vector_CAN_Start() is called. This allows the
component to restart without reinitialization after the first call to the Vector_CAN_Start()
routine. If reinitialization of the component is required, then the Vector_CAN_Init() function
can be called before the Vector_CAN_Start() or Vector_CAN_Enable() function.
MISRA Compliance
This section describes the MISRA-C:2004 compliance and deviations for the component. There
are two types of deviations defined:
▪ project deviations – deviations that are applicable for all PSoC Creator components
▪ specific deviations – deviations that are applicable only for this component
This section provides information on component-specific deviations. Project deviations are
described in the MISRA Compliance section of the System Reference Guide along with
information on the MISRA compliance verification environment.
The Vector CAN component does not have any specific deviations.
This component has the following embedded components: Interrupt, Clock. Refer to the
corresponding component datasheet for information on their MISRA compliance and specific
deviations.
Functional Description
For a complete description of the CAN Core, refer to the Controller Area Network (CAN) chapter
in the Technical Reference Manual.
For a complete description of the Vector GENy tool, refer to the Vector GENy tool
documentation.
Create a Blank PSoC Project and a Directory for the CAN Driver Files
Before starting to work with the Vector GENy tool to generate the CAN driver files, you should
create a PSoC project, so that the Vector GENy tool can place the driver files directly in the
PSoC project directory. The PSoC project will be empty for the moment.
Create a directory for the CAN driver generated files in the PSoC project directory, as shown in
Figure 2.
Generate the Vector CAN Driver Files for the PSoC Application
The Vector GENy tool generates the CAN driver files for PSoC based on:
1. The Setup Dialog that is displayed when you click on the New button has no options
other than the ones shown, so click OK.
6. After selecting the Tx and Rx messages, select and configure the acceptance filter and bus
timing as shown in the figures below.
The following figures show these steps.
The clock selected in the CAN bustiming window must be the same as BUS_CLK in the
PSoC 3 project.
When choosing polling or interrupt mode, remember that in polling mode the application has to
call the function CanTask() to service pending events or messages. In interrupt mode, events or
messages are serviced by the interrupt service routine CanIsr_0().
After the acceptance filter and bus timing and mailbox polling/interrupt modes are set up, select
the CAN driver files directory.
Create these directories within the PSoC project directory (as described earlier) so that
everything related to the project is in one place.
In the Generation Directories dialog window, set Root path for relative directories to the
subdirectory created in the PSoC project directory.
Figure 9. Click on “Generate System” to Generate the Files in the PSoC Project
Subdirectory
Figure 10. Save the Vector GENy Configuration in the PSoC Project Subdirectory
If, during installation, the default directories were accepted, the common files are located in:
C:\Vector\CBD0810092_D00_Psoc3\BSW
The full BSW directory should be copied into the PSoC project folder, and the _can_inc.h file
name in the Can subdirectory should be changed to can_inc.h (remove the leading “_”).
Figure 11. CAN Driver Common Directories Copied to the PSoC Project Folder
Now you can close the Vector GENy tool. Everything is set up to proceed with the PSoC project.
When the import step is finished, the workspace explorer should look like Figure 15.
The Vector CAN Driver APIs use function pointers. The Keil compiler for PSoC 3 does function
call analysis to determine how it can overlay function variables and arguments. When function
pointers are present the compiler cannot adequately analyze the calling structure, so the
NOOVERLAY option is selected to avoid problems that occur because of the use of function
pointers. Further information on the handling of function pointers with the Keil compiler is
available in the application note: Function Pointers in C51
(www.keil.com/appnotes/docs/apnt_129.asp).
▪ Write the necessary functionality using an API from Vector CAN and generated by the
Vector GENy tool.
Resources
The Vector CAN component uses the dedicated CAN hardware block in the silicon.
CAN DC Specifications
Parameter Description Conditions Min Typ Max Units
IDD Block current consumption -- -- 200 μA
CAN AC Specifications
Parameter Description Conditions Min Typ Max Units
Bit rate Minimum 10 MHz clock -- -- 1 Mbit
Component Errata
This section lists known problems with the component.
Cypress Component
ID Version Problem Workaround
191257 v1.10 This component was modified without a version No workaround is necessary.
number change in PSoC Creator 3.0 SP1. For There is no impact to designs.
further information, see Knowledge Base Article
KBA94159 (www.cypress.com/go/kba94159).
Component Changes
This section lists the major changes in the component from the previous version.
Version Description of Changes Reason for Changes / Impact
1.10.e Minor datasheet edits.
1.10.d Changed minimum clock value to 10 MHz. Disabled invalid bit timing configuration.
1.10.c Edited datasheet to add Component Errata Document that the component was changed, but
section. there is no impact to designs.
1.10.b Updated datasheet. Removed references to obsolete PSoC 5 device.
1.10.a Fixed issue with Bus clock visualization in the
Configure dialog, for Bus clock values more
than 32 MHz.
1.10 Added return values description for
Vector_CAN_Start(),Vector_CAN_Stop(),
Vector_CAN_Init(),Vector_CAN_Enable(),
Vector_CAN_GlobalIntEnable(), and
Vector_CAN_GlobalIntDisable() functions.
Added MISRA Compliance section. The component does not have any specific
deviations.
1.0.b Updated DC and AC Electrical Characteristics Information was incomplete.
section.
Minor datasheet edits. Improve readability.
1.0.a Updated rev number for release to the web. No changes.
© Cypress Semiconductor Corporation, 2012-2017. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including Spansion LLC (“Cypress”). This
document, including any software or firmware included or referenced in this document (“Software”), is owned by Cypress under the intellectual property laws and treaties of the United States and
other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights,
trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use
of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software
provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in
binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress’s
patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use,
reproduction, modification, translation, or compilation of the Software is prohibited.
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY
SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of
the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided
only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and
any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons
systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous
substances management, or other uses where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”). A critical component is any
component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in
whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify
and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of
Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, WICED, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of
Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective
owners.