UART Issue with PICDEM PlUS 2 board

  • Thread starter Thread starter Neyolight
  • Start date Start date
  • Tags Tags
    Board
Click For Summary
The user is experiencing UART communication issues with their PICDEM 2 Plus board after initial successful programming. They receive various error messages across different terminal software, indicating a potential problem with the COM port settings or hardware. A loopback test confirmed that the serial-to-USB adapter and laptop COM port function correctly, suggesting the issue lies with the board itself. Suggestions include checking for hardware faults or resetting the device. The discussion highlights the importance of troubleshooting both software and hardware components in UART communication failures.
Neyolight
Messages
15
Reaction score
0
Hi Everyone

I have a PICDEM 2 Plus board with a PIC18F4620 on it. My UART code is given. The code worked perfectly fine the first time i programmed my chip but stopped working after that.

With Hyperterminal the error is : "Unable to open COMPORT 1. Please check your port setting"

With RealTer , the error is : Break condition received

With Putty : Nothing happens

I performed a loopback test on the board ( by taking our the PIC ) and Serial-to USAB adaptor and both works fine. The comport on my laptop works fine with other UART. Please guide me..I AM SUPER LOST !

Heres the code



#include <p18f4620.h>
#include <stdio.h>
#include <delays.h>
#include <usart.h>

// INTIO67 configures internal oscillator
#pragma config OSC=INTIO67, LVP=OFF, MCLRE=ON , WDT=OFF

void setup(void)
{
/* Clock Setup*/
OSCCON = 0b01110010; //select 8 MHz clock

/* Port Set Up*/
ADCON1 = 0b00001111; //set all pins to digital mode
TRISD = 0x00;
TRISA = 0x00;
TRISB = 0b00000000;
TRISC = 0b10000000; // RX is an input, TX is output

// PORTBbits.RB0=1; //Turn on the 4 LEDs
// PORTBbits.RB1=1;
// PORTBbits.RB2=1;
// PORTBbits.RB3=1;

// Turn on the 4 LEDs
// Microchip recommends writing to the PORT Latch rather than the PORT Pins
LATBbits.LATB0=1;
LATBbits.LATB1=1;
LATBbits.LATB2=1;
LATBbits.LATB3=1;


/* Interrupt Setup */
INTCON = 0x00; /* Clear Registers */
PIR1 = 0x00;
PIE1 = 0x00;
TMR1L = 0x00;
TMR1H = 0x00;
T1CON = 0x00;
RCON = 0x00;



/* RS232 Enable */
// OpenUSART Configures The Next Three Lines
//RCSTA = 0b10000000;
//TXSTA = 0b00100000;
//BAUDCON = 0b01000000;

// USART 9600 8-N-1
OpenUSART (USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_LOW, 12);

}


#pragma code
void main(void)
{
setup();

while (1)
{
putrsUSART(" Hello World! ");
// while(BusyUSART());
Delay10KTCYx(100);

}
}
 
Engineering news on Phys.org
If it worked once, then won't work again, I presume there must be some kind of hardware fault, or that you changed the state of the device.

Have you tried power off/on reset?
 
I am trying to understand how transferring electric from the powerplant to my house is more effective using high voltage. The suggested explanation that the current is equal to the power supply divided by the voltage, and hence higher voltage leads to lower current and as a result to a lower power loss on the conductives is very confusing me. I know that the current is determined by the voltage and the resistance, and not by a power capability - which defines a limit to the allowable...

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
7K