English 中文(简体)
A. uart和pic 18f452
原标题:An issue with uart and pic 18f452

i have a problem with pic18f452 and uart i use simplest code like that:

 UART1_Init(9600);              // Initialize UART module at 9600 bps
 Delay_ms(100);                 // Wait for UART module to stabilize

无论在哪里,

  UART1_Write_Text("HELLO2");
  Delay_ms(1000);

also i have in my hardware lcd module it works very fine but my received data on pc is a scrap like that

???m

i have checked all connection sothand time nothing wrong also i have changed MAX232 ic but with no luck ?! my hardware is like that enter image description here

finall all my connections are ok (polarity and every thing else ?) EDIT : i use mikroc as a compiler

最佳回答

看起来像一种 b差率错误。 您是否检查过你的振荡环境造成预期的频率? 您使用的系列图书馆是否预期会出现某些24小时的频率,而且你确信,你是在这种频率下运行的,还是用一套频率开展工作的,你正确地把你使用的频率告知系列图书馆? 此外,最好把收到的按母体分类,而不是仅仅视为ASCII。

问题回答

起始点、数据比数、对等和截点是什么? 这两项目标是否相同?

It happens when you have loose connections i.e. from max 232 to Pic & from max 232 to PC. Try checking the fluctuations over the transmit pin or usr Oscilloscope to see the ASCII values of Hello World alphabets.





相关问题
How to "echo off" the serial port in java

I am using java comm library for serial port communication in my application. When I put some data on output stream, after sometime the same command is displayed on input stream of serial port. Do ...

Can someone please explain COMTIMEOUTS for me?

I have an application that has strict timing. Inter-character delay must be no more than is 0.15s The messages themselves are quite small. 10 - 50 chars I don t understand what ...

Unable to open serial port in .NET

I am trying to open COM1, but get a strange error every time I call SerialPort.Open(). The error is: The given port name does not start with COM/com or does not resolve to a valid serial port. ...

Serial programming: measuring time between characters

I am sending/receiving data over a serial line in Linux and I would like to find the delay between characters. Modbus uses a 3.5 character delay to detect message frame boundaries. If there is more ...

send string to serial

Buongiorno, I m trying to send a simple string to a serial port to command an instrument for noise measures. The strings are very easy: "M 1" = instrument on "M 2" = instrument off "M 3" = begin the ...

Java RS232 Comm on Vista-64 bit

We have a Java application which needs to communicate with a peripheral device over Virtual Serial COM port. We use the RS232 Java COMM API (javax.comm.properties, comm.jar, win32com.dll) to achieve ...

热门标签