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 support@ccsinfo.com

dspic30f6010a uart problem

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



Joined: 26 Nov 2009
Posts: 19

View user's profile Send private message

dspic30f6010a uart problem
PostPosted: Mon Jan 11, 2010 9:10 pm     Reply with quote

I'm using dspic30f6010a, I'm trying to use uart with interrupt.

Here is my code, I'm not getting receive interrupt. Please any one can help me? Thanks.
Code:

#include <30F6010A.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES PR                       //Primary Oscillator
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES WPSB16                   //Watch Dog Timer PreScalar B 1:16
#FUSES WPSA512                  //Watch Dog Timer PreScalar A 1:512
#FUSES PUT64                    //Power On Reset Timer value 64ms
#FUSES NOBROWNOUT               //No brownout reset
#FUSES BORV47                   //Brownout reset at 4.7V
#FUSES LPOL_HIGH                //Low-Side Transistors Polarity is Active-High (PWM 0,2,4 and 6)
   //PWM module low side output pins have active high output polar
#FUSES HPOL_HIGH                //High-Side Transistors Polarity is Active-High (PWM 1,3,5 and 7)
   //PWM module high side output pins have active high output polarity
#FUSES NOPWMPIN                 //PWM outputs drive active state upon Reset
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOCOE                    //Device will reset into operational mode
#FUSES ICSP1                    //ICD uses PGC1/PGD1 pins
#FUSES RESERVED                 //Used to set the reserved FUSE bits

#use delay(clock=12000000)
#include <stdio.h>
#use rs232(UART1,baud=9600,parity=E,bits=8,errors)


char c;
#int_RDA
void  RDA_isr(void)
{   
   c=fgetc();
   clear_interrupt(int_RDA);
}

void main()
{
   setup_spi(SPI_SS_DISABLED);
   setup_spi2(SPI_SS_DISABLED);

   setup_wdt(WDT_Off);

   enable_interrupts(INT_RDA);
    // TODO: USER CODE!!

loop:
   delay_ms(200);
   goto loop;
}

Question Smile
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Jan 12, 2010 1:27 am     Reply with quote

no cross-posting.
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