Sign in

username:

password:



Not a member?

Search motoroladsp



Search tips

Subscribe to motoroladsp



motoroladsp by Keywords

56303 | 563xx | 5680 | 56805 | 5680x | 56F80 | 56F800DEMO | 56F805 | 56f807 | 56F830 | ADC | Bootloader | Codec | CodeWarrior | CW5 | CW6 | Debugger | DSP56303 | DSP56303EVM | DSP563xx | DSP5680 | DSP56800 | DSP56807 | DSP56858 | DSP56858EVM | DSP56F803 | DSP56F805 | DSP56F807 | DSP56F80x | DSP56F826 | DSP56F827 | DSP56F8xx | EVM | FFT | Flash_over_jtag | GPIO | Interrupt | Interrupts | JTAG | LCD | Linker | MCF5307 | Metrowerks | Modulus | MSCAN | PCMaster | PWM | Quad | Rif | RTOS | SDK | SPI

Ads

Discussion Groups

Discussion Groups | Freescale DSPs | CAN TX PROBLEM WITH 56F83232EVM

Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).

  

Post a new Thread

CAN TX PROBLEM WITH 56F83232EVM - simo...@hotmail.com - May 10 7:17:16 2006



Hi to everybody,

 I'm a young electronical engeneer and i'm using for the first time an EVM with 56f83232. I try
to configure the flexcan module following the instrustion on the chapter 7 of the 56f8300
peripheral user manual and i also have an example bean to help me in the initialization.
My CAN1_Init() function is :

void CAN1_Init()
{ 
  setRegBit(FCMCR, SOFT_RST);          /* Soft-reset of the FlexCAN 
  while(!getRegBit(FCMCR, FREEZ_ACK)){} /* Wait for entering the debug 
  
  setRegBit(FCMAXMB, MAXMB0);
  setRegBit(FCMAXMB, MAXMB1);
  clrRegBit(FCMAXMB, MAXMB2);
  clrRegBit(FCMAXMB, MAXMB3);
  
  setReg16(FCCTL0, 2);                 /* Set the Control 0 register */

  // Initialization of all message buffers 
  setReg(FCMB0_Control, 64);           
  setReg(FCMB0_ID_HIGH, 0);              
  setReg(FCMB0_ID_LOW,0);  
  setReg(FCMB1_Control, 64);           
  setReg(FCMB1_ID_HIGH, 0);            
  setReg(FCMB1_ID_LOW,0);  

  setReg(FCMB2_Control, 0);           
  setReg(FCMB2_ID_HIGH, 0);

  // FCRXGMASK_L: 
  setReg16(FCRXGMASK_L, 0);            
  
  // FCRXGMASK_H: 
  setReg16(FCRXGMASK_H, 57352);       
  
  // FCRX14MASK_L:  
 setReg16(FCRX14MASK_L, 65534);       
  
  // FCRX14MASK_H: 
  setReg16(FCRX14MASK_H, 65519);       
  
  // FCRX15MASK_L: 
  setReg16(FCRX15MASK_L, 65534);       
  
  // FCRX15MASK_H: 
  setReg16(FCRX15MASK_H, 65519);         
  setReg16(FCCTL1, 2304);                
  clrRegBits(FCMCR,FCMCR_HALT_MASK | FCMCR_FRZ1_MASK); 
  getReg(FCIFLAG1);                  /* Dumy read of the MB interrupt 
  setReg(FCIFLAG1,0xFFFF); 
  
  // FCIMASK1:  	
setReg16(FCIMASK1, 4);

  setRegBits(FCSTATUS,7); /* Reset interrupt flags */
  setRegBits(FCCTL0,(FCCTL0_BUSOFF_MASK_MASK)); /* Enable interrupts */

  }
  
To test the transmission i put on MB2 registers the data and i give the tx code on FCMB
control.
 
   setReg(FCMB2_Control, 0x0080);             
   
   setReg(FCMB2_ID_HIGH, 0);               
   setReg(FCMB2_DATA0, 0x0000);           
   setReg(FCMB2_DATA1, 0xFFFF);           
   setReg(FCMB2_DATA2, 0x0000);           
   setReg(FCMB2_DATA3, 0xFFFF);            
   setReg(FCMB2_Control, 0x00C8);                      
  
  I check with the oscilloscope and i see the transmission but the device 
continue the transmission continuously ,and i'm not able to see the interrupt of succesfull
transmission.
 There is someone who can give me a hand solving this problem or giving me some suggestion?

Cheers
SIMONE BENATTI





(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )

Re: CAN TX PROBLEM WITH 56F83232EVM - Charlie W - May 11 6:37:22 2006

Try this code which someone posted before

//CAN initialization
void init()
{
	unsigned int timer;

	//soft reset
	FCMCR |= 0x0200;
	
	//initialize all operation modes
	FCCTL0 &=~ 0x0007;
	FCCTL1 = 0x2FDB;			// 125K
	FCMAXMB = 0x0002;	
	
	//initialize message buffer
	FCMB0_Control = 0;
	FCMB1_Control = 0;
	FCMB2_Control = 0;
	FCMB3_Control = 0;
	FCMB4_Control = 0;
	FCMB5_Control = 0;
	FCMB6_Control = 0;
	FCMB7_Control = 0;
	FCMB8_Control = 0;
	FCMB9_Control = 0;
	FCMB10_Control = 0;
	FCMB11_Control = 0;
	FCMB12_Control = 0;
	FCMB13_Control = 0;
	FCMB14_Control = 0;
	FCMB15_Control = 0;
	
	//initialize MASK registers
	FCRXGMASK_H = 0x0000;
	FCRXGMASK_L = 0x0000;

        // Configure MB1 for RX
        FCMB1_ID_HIGH = 0xC7EE; // MB1 = RX, Ext. ID
        FCMB1_ID_LOW = 0x003C; // CAN ID =0x18FF001E,
Data Frame 

	//initialize interrupt handler
	FCCTL0 |= 0xC000;  //Enable busoff interrupt and
error interrupt

	//clear HALF bit in FC_MCR
	FCMCR = 0x0000;
	
	timer = FCTIMER;				// Read free running timer to
unlock MB
	
	timer=0;
	while((FCMCR&0x0800)==0x800){
	  if(timer++>=0x6000)
	    break;
	}
}

// CAN transimssion
void can_tx()
{	unsigned int n,status;

	FCMB0_Control |= 0x0080;		//MB0 is inactive 
// Configure MB0 for TX
      FCMB0_ID_HIGH = 0xC7FE; 		// MB0 = TX, Ext. ID
      FCMB0_ID_LOW = 0x003C; 			// CAN ID =0x18FF001E,
Data Frame
 	FCMB0_ID_HIGH |= 0x0018; 		//IDE = 1 & SRR = 1;
 	FCMB0_ID_LOW &=~ 0x0001;		//RTR = 0;
        
// Copy Tx data bytes to the message buffer
        FCMB0_DATA0 = CANTxMsg[0].i;
        FCMB0_DATA1 = CANTxMsg[1].i;
        FCMB0_DATA2 = CANTxMsg[2].i;
        FCMB0_DATA3 = CANTxMsg[3].i;
		
      FCMB0_Control |= 0x00C8;	 		//Length of the data
= 8
			
    status = FCIFLAG1;
    n=0;
    while((status & 0x0001)!=1)  // polling
    {
      if(n++>0x6000)
        break;
      status = FCIFLAG1; 
    }		
}
Charlie

--- s...@hotmail.com wrote:

> Hi to everybody,
> 
>  I'm a young electronical engeneer and i'm using for
> the first time an EVM with 56f83232. I try to
> configure the flexcan module following the
> instrustion on the chapter 7 of the 56f8300
> peripheral user manual and i also have an example
> bean to help me in the initialization.
> My CAN1_Init() function is :
> 
> void CAN1_Init()
> { 
>   setRegBit(FCMCR, SOFT_RST);          /* Soft-reset
> of the FlexCAN 
>   while(!getRegBit(FCMCR, FREEZ_ACK)){} /* Wait for
> entering the debug 
>   
>   setRegBit(FCMAXMB, MAXMB0);
>   setRegBit(FCMAXMB, MAXMB1);
>   clrRegBit(FCMAXMB, MAXMB2);
>   clrRegBit(FCMAXMB, MAXMB3);
>   
>   setReg16(FCCTL0, 2);                 /* Set the
> Control 0 register */ 
>   
>   
>   // Initialization of all message buffers 
>   setReg(FCMB0_Control, 64);           
>   setReg(FCMB0_ID_HIGH, 0);              
>   setReg(FCMB0_ID_LOW,0);  
>   setReg(FCMB1_Control, 64);           
>   setReg(FCMB1_ID_HIGH, 0);            
>   setReg(FCMB1_ID_LOW,0);  
> 
>   setReg(FCMB2_Control, 0);           
>   setReg(FCMB2_ID_HIGH, 0);            
>   
>   
>   
>   // FCRXGMASK_L: 
>   setReg16(FCRXGMASK_L, 0);            
>   
>   // FCRXGMASK_H: 
>   setReg16(FCRXGMASK_H, 57352);       
>   
>   // FCRX14MASK_L:  
>  setReg16(FCRX14MASK_L, 65534);       
>   
>   // FCRX14MASK_H: 
>   setReg16(FCRX14MASK_H, 65519);       
>   
>   // FCRX15MASK_L: 
>   setReg16(FCRX15MASK_L, 65534);       
>   
>   // FCRX15MASK_H: 
>   setReg16(FCRX15MASK_H, 65519);         
>   setReg16(FCCTL1, 2304);                
>   clrRegBits(FCMCR,FCMCR_HALT_MASK |
> FCMCR_FRZ1_MASK); 
>   getReg(FCIFLAG1);                  /* Dumy read of
> the MB interrupt 
>   setReg(FCIFLAG1,0xFFFF); 
>   
>   // FCIMASK1:  	
> setReg16(FCIMASK1, 4);		             
>   
> 
>   setRegBits(FCSTATUS,7); /* Reset interrupt flags
> */
>   setRegBits(FCCTL0,(FCCTL0_BUSOFF_MASK_MASK)); /*
> Enable interrupts */
> 
>   }
>   
> To test the transmission i put on MB2 registers the
> data and i give the tx code on FCMB control.
>  
>    setReg(FCMB2_Control, 0x0080);             
>    
>    setReg(FCMB2_ID_HIGH, 0);               
>    setReg(FCMB2_DATA0, 0x0000);           
>    setReg(FCMB2_DATA1, 0xFFFF);           
>    setReg(FCMB2_DATA2, 0x0000);           
>    setReg(FCMB2_DATA3, 0xFFFF);            
>    setReg(FCMB2_Control, 0x00C8);                   
>   
>   
>   I check with the oscilloscope and i see the
> transmission but the device 
> continue the transmission continuously ,and i'm not
> able to see the interrupt of succesfull
> transmission.
>  There is someone who can give me a hand solving
> this problem or giving me some suggestion?
> 
> Cheers
> SIMONE BENATTI
__________________________________________________





(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )

Re: CAN TX PROBLEM WITH 56F83232EVM - Marek Vinkler - May 11 11:23:53 2006

Hi,

You probably have no connected another CAN device to the CAN bus and the=20
CAN device tries to deliver a message to an another CAN node. When the=20
CAN bus is configured correctly, you should see only one frame to be=20
transmitted on the oscilloscope.

S pozdravem,

Marek Vinkler
m...@atlas.cz

s...@hotmail.com wrote:
> Hi to everybody,
>=20
>  I'm a young electronical engeneer and i'm using for the first time an EV=
M with 56f83232. I try to configure the flexcan module following the instru=
stion on the chapter 7 of the 56f8300 peripheral user manual and i also hav=
e an example bean to help me in the initialization.
> My CAN1_Init() function is :
>=20
> void CAN1_Init()
> {=20
>   setRegBit(FCMCR, SOFT_RST);          /* Soft-reset of the FlexCAN=20
>   while(!getRegBit(FCMCR, FREEZ_ACK)){} /* Wait for entering the debug=20
>=20=20=20
>   setRegBit(FCMAXMB, MAXMB0);
>   setRegBit(FCMAXMB, MAXMB1);
>   clrRegBit(FCMAXMB, MAXMB2);
>   clrRegBit(FCMAXMB, MAXMB3);
>=20=20=20
>   setReg16(FCCTL0, 2);                 /* Set the Control 0 register */=20
>=20=20=20
>=20=20=20
>   // Initialization of all message buffers=20
>   setReg(FCMB0_Control, 64);=20=20=20=20=20=20=20=20=20=20=20
>   setReg(FCMB0_ID_HIGH, 0);=20=20=20=20=20=20=20=20=20=20=20=20=20=20
>   setReg(FCMB0_ID_LOW,0);=20=20
>   setReg(FCMB1_Control, 64);=20=20=20=20=20=20=20=20=20=20=20
>   setReg(FCMB1_ID_HIGH, 0);=20=20=20=20=20=20=20=20=20=20=20=20
>   setReg(FCMB1_ID_LOW,0);=20=20
>=20
>   setReg(FCMB2_Control, 0);=20=20=20=20=20=20=20=20=20=20=20
>   setReg(FCMB2_ID_HIGH, 0);=20=20=20=20=20=20=20=20=20=20=20=20
>=20=20=20
>=20=20=20
>=20=20=20
>   // FCRXGMASK_L:=20
>   setReg16(FCRXGMASK_L, 0);=20=20=20=20=20=20=20=20=20=20=20=20
>=20=20=20
>   // FCRXGMASK_H:=20
>   setReg16(FCRXGMASK_H, 57352);=20=20=20=20=20=20=20
>=20=20=20
>   // FCRX14MASK_L:=20=20
>  setReg16(FCRX14MASK_L, 65534);=20=20=20=20=20=20=20
>=20=20=20
>   // FCRX14MASK_H:=20
>   setReg16(FCRX14MASK_H, 65519);=20=20=20=20=20=20=20
>=20=20=20
>   // FCRX15MASK_L:=20
>   setReg16(FCRX15MASK_L, 65534);=20=20=20=20=20=20=20
>=20=20=20
>   // FCRX15MASK_H:=20
>   setReg16(FCRX15MASK_H, 65519);=20=20=20=20=20=20=20=20=20
>   setReg16(FCCTL1, 2304);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
>   clrRegBits(FCMCR,FCMCR_HALT_MASK | FCMCR_FRZ1_MASK);=20
>   getReg(FCIFLAG1);                  /* Dumy read of the MB interrupt=20
>   setReg(FCIFLAG1,0xFFFF);=20
>=20=20=20
>   // FCIMASK1:=20=20=09
> setReg16(FCIMASK1, 4);=09=09=20=20=20=20=20=20=20=20=20=20=20=20=20
>=20=20=20
>=20
>   setRegBits(FCSTATUS,7); /* Reset interrupt flags */
>   setRegBits(FCCTL0,(FCCTL0_BUSOFF_MASK_MASK)); /* Enable interrupts */
>=20
>   }
>=20=20=20
> To test the transmission i put on MB2 registers the data and i give the t=
x code on FCMB control.
>=20=20
>    setReg(FCMB2_Control, 0x0080);=20=20=20=20=20=20=20=20=20=20=20=20=20
>=20=20=20=20
>    setReg(FCMB2_ID_HIGH, 0);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
>    setReg(FCMB2_DATA0, 0x0000);=20=20=20=20=20=20=20=20=20=20=20
>    setReg(FCMB2_DATA1, 0xFFFF);=20=20=20=20=20=20=20=20=20=20=20
>    setReg(FCMB2_DATA2, 0x0000);=20=20=20=20=20=20=20=20=20=20=20
>    setReg(FCMB2_DATA3, 0xFFFF);=20=20=20=20=20=20=20=20=20=20=20=20
>    setReg(FCMB2_Control, 0x00C8);                     =
=20
>=20=20=20
>   I check with the oscilloscope and i see the transmission but the device=
=20
> continue the transmission continuously ,and i'm not able to see the inter=
rupt of succesfull transmission.
>  There is someone who can give me a hand solving this problem or giving m=
e some suggestion?
>=20
> Cheers
> SIMONE BENATTI
>=20
>=20
>=20
>=20
>=20
>=20
> 
>=20
>=20
>=20
>=20=20
>=20
>=20
>=20
>=20
>=20
>=20

=20

=20


(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )