 |
 |
| View previous topic :: View next topic |
| Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 11, 2017 11:46 pm |
|
|
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
|
|
Posted: Thu Jan 12, 2017 12:43 am |
|
|
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
|
|
Posted: Thu Jan 12, 2017 3:00 am |
|
|
Problem solved, cold soldering of the connector pin
In any case, I learned a few things
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 |
|
 |
|
|
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
|