Problem with sending a string from uC to PC using FTDI

Hello,

I am using a FT232BL in order to connect a PIC18F2450 to a USB-PORT. The FTDI is using a 48MHZ and my serial port hat 9600 bis/s so I am using the baudrate 51.

In order to test the FTDI-Device I am trying to send a string to a terminal (Hterm or Tera Term) but I just receive blanks "\n" :(

Could you please help me to find the mistake in my code, thank you!!!

#include #include #include "p18f2450.h"

#pragma config FCMEN = ON //Fail-Safe Clock Monitor enabled #pragma config IESO = OFF //Oscillator Switchover mode disabled #pragma config PWRT = OFF //Power-up Timer disabled #pragma config MCLRE = ON //MCLR pin enabled, RE3 input pin disabled #pragma config LPT1OSC = OFF //Disabled, T1 operates in standard power mode

#pragma config PBADEN = OFF //PORTB pins are configured as digital I/O on Reset

#pragma config STVREN = ON //Stack full/underflow will cause Reset #pragma config LVP = OFF //Single-Supply ICSP disabled #pragma config WDT = OFF // NO WATCH DOG TIMER

#define BAUD_RATE_GEN 51

void main (void){ unsigned char Txdata[]= "HELLO";

OpenUSART(USART_TX_INT_ON & USART_RX_INT_ON & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_LOW, BAUD_RATE_GEN);

while(1){ putsUSART((char *)Txdata); }//End while

CloseUSART();

}//End void

Best regards

--------------------------------------- Posted through

formatting link

Reply to
c140986
Loading thread data ...

try putsUSART(TxData) also what are you doing about the transmit & receive interrupts, assuming interrupts are getting enabled somewhere?

Reply to
daven

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.