scorrpeio
Full Member level 5

Hello,
I have interfaced TRF7960 with MSP430F2370. I am trying to implement the ISO15693 protocol in it...........as
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.
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.