Motor de Búsqueda de Datasheet de Componentes Electrónicos
  Spanish  ▼
ALLDATASHEET.ES

X  

AN2628 Datasheet(PDF) 10 Page - STMicroelectronics

No. de pieza AN2628
Descripción Electrónicos  Programming ST10F27x CAN interrupt drivers
PDF  27 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Fabricante Electrónico  STMICROELECTRONICS [STMicroelectronics]
Página de inicio  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2628 Datasheet(HTML) 10 Page - STMicroelectronics

Back Button AN2628 Datasheet HTML 6Page - STMicroelectronics AN2628 Datasheet HTML 7Page - STMicroelectronics AN2628 Datasheet HTML 8Page - STMicroelectronics AN2628 Datasheet HTML 9Page - STMicroelectronics AN2628 Datasheet HTML 10Page - STMicroelectronics AN2628 Datasheet HTML 11Page - STMicroelectronics AN2628 Datasheet HTML 12Page - STMicroelectronics AN2628 Datasheet HTML 13Page - STMicroelectronics AN2628 Datasheet HTML 14Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 10 / 27 page
background image
Programming through CAN hardware features
AN2628
10/27
3
Programming through CAN hardware features
Programming the CAN interrupt drivers through CAN hardware features uses bits RXIE and
TXIE in the message control register of each message object. Whenever a message is
transmitted or received by a message object, the corresponding interrupt is serviced
according to its priority (based on the value of IntId). This method uses the hardwired priority
scheme of the CAN module and requires minimum CPU overhead. This section provides a
sample program for programming through CAN hardware features.
Hints:
●
If the Status Change Interrupt is enabled, the CPU is interrupted every time a message
is acknowledged on the CAN bus. Disable the Status Change Interrupt!
●
RXOK is cleared by the Status Change Interrupt routine. Therefore, do not use RXOK
to identify the cause of interrupts.
●
TXOK can be used to identify the cause of an interrupt if the Status Change Interrupt is
disabled and if TXOK is cleared by every interrupt routine of message objects with
direction = ‘transmit’. For clarity, the example below assumes that Status Change
Interrupt is enabled.
●
There are two ways to use the sample program provided below:
–
The software interrupt driver repeats itself as long as there is an active interrupt in
the CAN module.
–
The software driver is run once and handles only one interrupt. This allows the
interrupt controller to re-arbitrate interrupts of the same priority level but not of a
higher priority group.
// CAN interrupt driver
include <REGF2xxx.h> // standard include file for F27x/F25x
#include "CCAN_drvs.h" // inc file to define bit masks and macro
// see Section 6 for description.
interrupt(0x4x) void CAN_IT (void)
// CAN Module IR, trap number 0x40, 0x41, 0x43,
// according to user choice, see Section 1.1
{
XIRxCLR = 0xXX; //flag to be cleared according to user choice
//see Section 1.1
unsigned char status, intid, control;
while (intid=CANxIR) //reload intid with CANxIR,
// continue loop if intid != 0
//‘while’can be removed to run IT driver once
{
status = CANxSR;// copy status + control REG to variable
control = CANxCR;
CANxSR=0; // clear status register
switch (intid)
{
case 0x8000: // Status Change Interrupt
if (CANxCR & SIE)// if SIE is set (status interrupts)
{



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27


Datasheet Descarga

Go To PDF Page


Enlace URL



¿ALLDATASHEET es útil para Ud.?  [ DONATE ] 

Todo acerca de Alldatasheet   |   Publicidad   |   Contáctenos   |   Política de Privacidad   |   Enlace a la hoja de datos    |   Intercambio de Enlaces   |   Lista de Fabricantes
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com