CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

INT_RDA no interrupt woes

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Hereoncapecod



Joined: 08 Dec 2003
Posts: 4

View user's profile Send private message Visit poster's website

INT_RDA no interrupt woes
PostPosted: Fri Oct 08, 2004 9:47 am     Reply with quote

Hi,

I am using a PIC16F648A with version 3.160.

I am relying on the external keyboard INT_RDA interrupt for normal program operation. I never seem to get the interrupt. I think I also tried using ERRORS to the USE RS232 with no success.

Is there any chance there is a compiler error?

There is minimal chance that the RS-232 lines are noisy as I have been using the same cable setup for sveral other PIC projects with no problems.

Please find below the simplified program which still does not interrupt on INT_RDA.

Thank you
Bruce A

// CCS version 3.160
#include <16F648A.h>
//#device ICD=true
#include <stdlib.h>
#fuses hs, NOWDT, NOLVP, PUT,NOBrownOut
#define LED 48
#define EECS 40
#define EESCK 41
#define EESDO 42
#use delay(clock = 8000000 )
#USE RS232(BAUD=9600,XMIT=PIN_B2,RCV=PIN_B1,PARITY=N,BITS=8) // 9600.N,8,1

void CalcADFParam (void );
long GetDataVal(void);
void InitCond( void );
void SPI( IntValue, FracValue ); // send SPI data to ADF4153
void updateParam( void );

struct {
short int Uart; // indicates uart has received data
short int CW; // Continuous frequency output
short int Sweep; // indicates sweep from lower to upper limits
short int Valid; // indicates all valid parameters present
short int ADCalc; // true after calculating ADF1453 parameters
short int Error; // true if parameters are in error
short int x3; // true when interrupt has occured
short int x4;
}flag;
// wakes PIC from sleep mode and prompts for new INT divider
static int intr;
int i;
long j;
long k;
long l;
long Contint;
int32 dum;
long FracLower; // counter limit for lower frequency
long FracCtLower; // FRAC counter lower, must be less than Mod
long FracCont;
long FracUpper; // counter limit for upper frequency
long FracCtCont;
long FracCtUpper; // FRAC counter upper, must be less than Mod
long FreqCont; // CW frequency in mHz
long FreqLower; // Lower frequency in mHz
long FreqUpper; // Upper Frequency in mHz
long LowerInt; // calculated lower integer
long ModAD; // calculated Mod from the start frequency
int32 NoSteps; // Number of steps from low to high frequency
long stepsize; // step size in kHz
long period; // Period in Ms per scan
long UpperInt; // Calculated Int from end frequency
byte retval;
long CReg; // control register
long SReg; // spur register
int32 RReg; // R register and fractional register
int32 NReg; // Integer and Mod register
long Control;
Long Spur;

#int_rda
void serial_isr()
{
intr = true;
printf ("int");
}
// -----
void CalcADFParam (void )
{
printf("\n\rContInt:%5ld FracCont:%5ld ModAD:%5ld dum:%5ld",ContInt,FracCont,ModAD,dum);
}
// input up to 5 digit character string, terminates after 2nd,3rd, or 4th character if CR detected
long GetDataVal(void)
{
}// =====
void InitCond( void )
{
}// =====
void SPI( IntValue, FracValue ) // send SPI data to ADF4153
{
}
// ------
void updateParam( void )
{
char x;
}
// -----
void main()
{
char x; // dummy character
output_high( PIN_B0 );
printf("\r\n"); // turn LED ON
printf("\n\rSynthesizer vs 1.01a\r\n");
output_low( PIN_B0 ); // turn LED OFF
InitCond();

enable_interrupts(INT_RDA);
enable_interrupts(Global);
intr = false;
printf("\n\rPress any key\n\r");
delay_ms(1000);
while (intr == false)
{
output_high( PIN_B0 ); // turn LED OFF
delay_ms(300);
output_low( PIN_B0 ); // turn LED OFF
delay_ms(300);
}
sleepLoop:
printf("\n\rInt");
updateParam();
CalcADFParam();
intr = false;
enable_interrupts(Global);
while (intr == false )
{
if( Flag.CW ) // sleep in fixed frequency modes
{
SPI( ContInt, FracCont);
}
}
goto SleepLoop;
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 08, 2004 10:35 am     Reply with quote

Quote:
I am relying on the external keyboard INT_RDA interrupt for normal
program operation. I never seem to get the interrupt.
http://www.ccsinfo.com/forum/viewtopic.php?t=19694&highlight=16f648a
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group