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

PIC24F16K101 UART Problem

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



Joined: 20 May 2011
Posts: 3
Location: Berlin / Germany

View user's profile Send private message

PIC24F16K101 UART Problem
PostPosted: Fri May 20, 2011 3:52 am     Reply with quote

Hello ...

I have a problem with the PIC24F16K101.
UART1 Pin11 and PIN6 is connected to a MAX232, the electronic functions are perfect, at pin 6 of the pic comes to the character from the terminal.

But the pic does not respond with the following code.
He run up to getc and stays there.

In the other direction, that's very good,
characters sent by the controller com on in the terminal program.

Code:

#include <main.h>
#include <stdlib.h>
#include "stdio.h"

char c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, d0;

#INT_RDA


void main()
{
setup_adc_ports(ALL_ANALOG,VSS_VDD ); 
setup_adc(ADC_CLOCK_DIV_4|ADC_TAD_MUL_8);


enable_interrupts(intr_global);


output_bit(pin_b13,1);
output_bit(pin_b15,1);
   
while(1)
{

#use rs232(uart1,baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B2,bits=8)

c1 = getc();

printf("%c",c1);

output_bit(pin_b13,0);delay_ms(250);output_bit(pin_b13,1);delay_ms(250);
}
}
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri May 20, 2011 4:30 am     Reply with quote

You have #int_rda without any interrupt code.
dl7vfx



Joined: 20 May 2011
Posts: 3
Location: Berlin / Germany

View user's profile Send private message

PostPosted: Fri May 20, 2011 5:11 am     Reply with quote

Thanks for the answer....,it is right #int rda has nothing to do there

But is not the problem.....

The same code (without #int rda) works on a PIC24FJ128GA010 properly
dl7vfx



Joined: 20 May 2011
Posts: 3
Location: Berlin / Germany

View user's profile Send private message

PostPosted: Fri May 20, 2011 6:51 am     Reply with quote

Hello ....

the problem is solved....

my extra RS232 PCI card for 2 additional RS232Ports has received but not sent correctly

to the internal com port it works well

greetings ...
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