Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with TX interrupt

Status
Not open for further replies.

scorrpeio

Full Member level 5
Joined
Dec 26, 2006
Messages
286
Helped
10
Reputation
20
Reaction score
9
Trophy points
1,298
Activity points
3,496
Hello,

I have interfaced TRF7960 with MSP430F2370. I am trying to implement the ISO15693 protocol in it...........as

Code:
#include "MSP430.h"
/******************************************************************************/
enum  RegAddress{CHIPSTATUSCTRL = 0x00, ISOCTRL, ISO14443BTX, ISO14443A, TXTIMER_HB, TXTIMER_LB, TX_PULSE, 
                 RXNORESPONSE_WAIT, RXWAIT_TIME, SYS_CLKCTRL, RXSPECIAL_SETTING, REGULATOR, IRQ_STATUS = 0X0C,
                 IRQMASK, COLLISION_POSITION, RSSI_LEVEL, FIFO_STATUS = 0X1C, TX_BYTE1, TX_BYTE2, FIFO_IO} RegAdd;

char  Data[100]; 
char* DataPtr;

char  Command[100];
char* CommandPtr;

/******************************************************************************/
void StartCondition            ( void );
void StopCondition_Single      ( void );
void StopCondition_Continous   ( void );
void Write_Single              ( char* DataPtr, char DataLength );
void Write_Continous           ( char* DataPtr, char DataLength );
void InventoryRequest          ( void );  
//void OscillatorSelect          ( void );
/******************************************************************************/

void main()
{
  WDTCTL = WDTPW + WDTHOLD;             // Stop WDT
  
  DataPtr    = &Data[0];
  CommandPtr = &Command[0];
  
  //  enum RegAddress RegAdd;
  int Enum_Index = 0;
    
  /* Enable the TRF7960 chip */
  P1DIR |= BIT0 + BIT3;
  P1OUT |= BIT0;
  
  /* Enable the TRF7960 Intrrupt */
  P2SEL &= ~BIT1;                       // Enable Intr on pin 2.1 of MCU
  P2DIR &= ~BIT1;                       // Set MCU Pin as input direction
  P2IES &= ~BIT1;                       // set +ve edge triggered interrupt
  P2IE  |=  BIT1;                       // Enable P2IFG flag
  P2IFG &= ~BIT1;
 
  /*Enable DATA_CLK */
  P3DIR |=  BIT3;
  P3OUT |=  BIT3;
  
  /* Configure Parallel Port for communication */
  P4DIR |= 0xFF;
  P4OUT |= 0x00;
  P3OUT |= BIT3;
  P4OUT  = 0xFF;
  P3OUT &= ~BIT3;

/* Oscillator Select*/
 //OscillatorSelect ( );

  Data[0] = 0x00;                     // chip Status Control
  Data[1] = 0x23;
  Data[2] = 0x09;                     // SYS_CLK and modulation control
  Data[3] = 0x19;  
  Write_Single( &Data[0], 4 );
  StopCondition_Single();
  InventoryRequest();  
    
  while(1)
  {
    //P1OUT &= ~BIT3;
  }
  
}

void StartCondition  ( void )
{
  P4OUT  = 0x00;
  P3OUT |= BIT3;
  P4OUT  = 0xFF;
  P3OUT &= ~BIT3;

}

void StopCondition_Single  ( void )
{
  P4OUT |= 0x80;	/* stop condition */
  P3OUT |= BIT3;
  P4OUT  = 0x00;
  P3OUT &= ~BIT3;
}

void StopCondition_Continous  ( void )
{
  P4OUT  = 0x00;
  P4DIR |= 0xFF ;
  P4OUT  = 0x80;
  __no_operation();
  P4OUT  = 0x00;
}

void Write_Single     ( char* DataPtr, char DataLength )
{
  int i;
  for( i = 0; i < DataLength; i++ )
  {
    P4OUT |= *DataPtr++;
    P3OUT |= BIT3;
    P3OUT &= ~BIT3;
  }

}
void Write_Continous  ( char* CommandPtr, char DataLength )
{
     *CommandPtr = ( 0x20 | *CommandPtr ); /* address, write, continous */
     *CommandPtr = ( 0x3f & *CommandPtr );	/* register address */
      for(DataLength; DataLength > 0; DataLength-- )
        {
	  P4OUT = *CommandPtr++;	/* send command */
	  P3OUT |= BIT3;
          P3OUT &= ~BIT3;
      	}				
  
}

void InventoryRequest ( )
{
  int flags = 0x06;
  unsigned char	i = 1, j = 3, command[2], NoSlots, found = 0;
  unsigned char	*PslotNo, slotNo[17];
  unsigned char	NewMask[8], NewLenght, masksize, Length, *maskValue;
  int size;
  unsigned int	k = 0;

  if((flags & BIT5) == 0x00)
    {						/* flag bit5 is the number of slots indicator */
	NoSlots = 16;           		/* 16 slots if bit is cleared */
        //EnableSlotCounter();
    }
  else
	NoSlots = 1;		                /* 1 slot if bit is set */
  
  Length    = 0x00;
  *maskValue = 0x00;
  
  slotNo[0] = 0x00;
  PslotNo = &slotNo[0];
  
  StartCondition();
  Command[0] = 0x8F;
  Command[1] = 0x91;
  Command[2] = 0x3D;
  Command[3] = 0x00;
  Command[4] = 0x04;
  Command[5] = 0x05;
  Command[6] = 0x01;
  Command[7] = Length;
  if( Length > 0 )
  { 
    for ( i = 0; i < masksize; i++ )
    {
      Command[ i + 8 ] = *( maskValue + i );
    }
    
  }
  
  Write_Continous(&Command[0], 8);
  StopCondition_Continous();
  
}

#pragma vector = PORT2_VECTOR
__interrupt void Port_B (void)	
{
  P1OUT |= BIT3;
  
}

I have glown the LED on P1 inside the interrupt routine.

However, I am not getting LED turned ON.

Kindly let me know........whats the bug. Why I am not getting any interrupt.
 

vijay s said:
i have complete code for this..
if u need i can share that...

Please please share it in this thread......
 

Check Complete code and documents for TRF7960 with MSP430...

excepting u will press Helped Button and donate some points, if it helps u
 

    scorrpeio

    Points: 2
    Helpful Answer Positive Rating
    V

    Points: 2
    Helpful Answer Positive Rating
Hello,

I have written the code............. (attached the code in parallel.txt file)

But, I continuously get the 0x00 from the IRQStatus Register...........

Can anyone tell me the solution
 

oops.... i'm not in a situation to help u with this code...

better u refer source code attached in my Past Post
 

Try with different interrupt configuration. Especially make sure that your interrupt it really +ve edge triggered.
 

Guys,

I could receive the response from Tag finally........

but hurdle is ahead............I spent 2 days over it but could not find solution........may by you could help me....
This is the problem............

I every time get the collision error.....though I swipe only one Tag.

I am not getting how this happening, getting collision even for single tag......

I am using ISO 15693 protocol and Read multi block with no UID configuration
 

Hi scorrpeio

I also meet problem with TX interrupt.
Try to porting TRF7960 Codes to another MCU.

but cannot transmit TX successfully.

in ISR_External_Interrupt() {
...
Register[0] = IRQStatus; /* IRQ status register address */
Register[1] = IRQMask; //Dummy read
//ReadSingle(Register, 2); /* function call for single address read */
ReadSingle(Register, 1); /* function call for single address read */
...

***************************************************
get TRF7960 IRQ_STATUS(0x0C) Register is 0xB4
not 0x80 or 0xC0 ...
***************************************************
...
}

could help me.

Thanks very much.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top