It is difficult to help as there is no indication what you have tried so far. Keep in mind that an embedded processor, in general, comes with no built in operating system. The printf() method on even a small Linux computer like an ARM based RaspberryPi invokes 100s if not 1000s of lines of code that are part of the operating system. In general, on an embedded processor, like a PIC, you need to write all that code if you truly want to abstract to the level of single method call such as printf(). In general, on an embedded processor, like a PIC, you need to first setup the physical interface. If you are using the UART device you may need to setup the BAUD rate and the Parity just to name 2 features. You may want to setup interrupts to better handle high speed transfers. Or you may try to handle everything in your code for simplicity sake. Most people do arrive at a solution where 1 function call is all that is needed to send data out a PIC serial port. But it is very unlikely they will try to emulate a printf() type of method. The reason being it is difficult to implement a method that can accept an arbitrary number of arbitrary types. I think you need to use something called a 'Template Processor'. Way beyond this discussion. St2000 I think the assumption was that your setup was not working and the results would be the same even after you changed the code. Hence the reason for using an oscilloscope along with the code change. We need to step back and see if your code and hardware were working at a more fundamental level. If you didn't look at the output with an oscilloscope then it would be difficult to make any progress. Quoted for emphasis. You need to get some SIMPLER code working, which sends just one character, before you try to do something more complicated. You keep saying 'I have checked baud rate', but don't mention what you actually checked. Something fundamental is wrong, so you need to fix that first. ![]() ![]() As a matter of interest, what terminal program are you using on your PC to monitor the serial port? What you describe is a Baud Rate mismatch. How are you checking the Baud rate (As ric has asked several times in previous posts)? The best way is to send 0x55 (ASCII 'U') and measure the bit time on an O'scope. RS232 communication with CCS C compiler. The CCS C compiler provides a very simple way to do serial communication via RS232. It hides all the register settings for the user. Only the some parameters have to be provided, the rest is done by the compiler. Comunicacion serial para conectar el telefono android que soporte OTG con dispositivos. Best apps and games on Droid Informer. Smart phones serial terminal program. USB equipment using SilLab CP210X, FTDI FT232. Sending a 7 RCIE = 1; // receive interrupt enable GIE = 1; // global interrupt enable PEIE = 1; // Peripheral Interrupt Enable bit Why are you enabling interrupts when you do not have an ISR? Did you step through this code in the MPLAB Simulator to ensure all registers are actually being properly setup? Contoh soal toeic pdf. And that the code is running the way you want? And how to check output with oscilloscope.
0 Comments
Leave a Reply. |