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

PIC18F26K22 UART2 settings
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 11, 2017 11:46 pm     Reply with quote

Your test program is way too complicated. Don't test streams, interrupts,
or the PLL. Only test UART2. The following program will do this.
First, if you see "Start" on your terminal program, then you know UART2
can transmit. Then if you type chars and get them back, you know it
can receive.

Make sure you turn off "Local Echo" in the options screen for your
terminal program. If you're using TeraTerm, this setting is in the
Setup/Terminal menu. Make sure the tickbox is not selected.
Code:

#include <18F26K22.h>
#fuses INTRC_IO,NOWDT,PUT,BROWNOUT
#use delay(clock=4M)
#use rs232(baud=9600, UART2, ERRORS)

//==========================
void main()
{
int8 c;

printf("Start: \n\r");

while(TRUE)
  {
   c = getc();
   putc(c);
  }

}



If this program works and you want to test the PLL, then add a short
delay of 5 ms at the start of main(). Put it right before the printf().
This gives the PLL enough time to start running before you attempt
to transmit characters.
gjs_rsdi



Joined: 06 Feb 2006
Posts: 476
Location: Bali

View user's profile Send private message Send e-mail

PostPosted: Thu Jan 12, 2017 12:43 am     Reply with quote

Thank you for the reply PCM programmer.

I compiled your program, not working with UART2, but working with UART1 if I make:
Code:
//#use rs232(baud=9600, UART2, ERRORS)
#use rs232(baud=9600, UART1, ERRORS)

I am making two new boards, I think is a hardware problem as Jay wrote.

Best wishes
Joe
gjs_rsdi



Joined: 06 Feb 2006
Posts: 476
Location: Bali

View user's profile Send private message Send e-mail

PostPosted: Thu Jan 12, 2017 3:00 am     Reply with quote

Problem solved, cold soldering of the connector pin Embarassed
In any case, I learned a few things Smile
It seems not a good idea to make long breaks in this job. Unfortunately I was abroad and had no possibility to work there.

Thank you for the help and time spent, PCM Programmer, Jay and RF_Developer

Best wishes
Joe

EDIT: One thing remain on internal oscillator:
Quote:
Configuration Fuses:
Word 1: 2800 INTRC_IO NOPLLEN PRIMARY NOFCMEN NOIESO

But the controller works correct, LED, rs2323
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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