![]() ![]() If you add manual gaps between the bytes (as you're doing with the waits) it can tolerate a little bit more.īut you're groping in the dark. RS232 communication can handle an absolute maximum of +-5% clock speed variation, and a practical maximum of 2-3%. The Baud rate clock might be approx 5% faster in the non-working case. You should still double-check the programming to find out exactly what data length you've programmed the chip to in both cases.Ģ - The BITS are too short. Change it to 7 bits and see what happens.īut from your explanation that isn't very likely. If the SCI is sending a start bit, seven data bits and a stop bit, but Teraterm is programmed to receive 8 bits then that would explain the problem. If that fixes the problem then there could be two causes.ġ - The BYTES are too short. > then measure the bit times and the transmitted data format.īy adding delays you are adding gaps between the serial characters. > The best thing to do is to see what is being transmitted with an oscilloscope, ![]() Your code sample had you not checking the transmit ready flags. TomE, I greatly appreciate you taking your time and following up on my concerns. Maybe if receives data as fast as I am trying to print data (Tx situation) it will act the same. I guess the only reason the Rx is working fine is because the MCU is not receiving the data fast enough. I even tried my program by reading the "Transmitter Complete Flag" status bit before write the second byte.Ĥ. I do know that I am cheating by adding a software delay and is not correct.ģ. This is done by reading the "Transmitter Data Ready" status bit.Ģ. I do know that I can't write a byte out until the previous one has left. I have a feeling that the "Processor Expert" is initialization some clock some where that is causing this mess. My problem is that the SAME code was running PROPERLY before is NOT running properly now. Recently, I installed the CW standard edition and every time i run my program, the "Processor Expert" runs first. Every time I ran the CW, the "Device Initialization" ran first. I have to say that I was using the CW special edition before. I had modified the code on this app note according to my MCU specs and was running it WITHOUT any problem before. AN2883, thoroughly explains the SCI module and gives a code example in the end. My program was running the AN2883 without any problem. I guess I did not explain my problem correctly. I have no idea what initialization PE does that cause the TRANSMISSION mechanism go corrupt. Now I have the CW standard version and the Processor Expert keeps running instead. In that version I only used the Device Initialization and everything worked. The only thing I can think of right now, may be that the Processor Expert Initialization is causing something. If I delay the Tx sequence (delay the time I write to SCID) things work a little better but I still get nonsense transmission. when I go in a FOR LOOP or try to print out say 4 characters)ĥ. When I want to print a bunch of character, the Tx just goes crazy. I see it popping up on my Tera Term terminal.Ĥ. I can transmit the same character I type in with no problem. After numerous hours of analyzing it here is what I am experiencing:Ģ The MCU can receive any characters I type in through my keyboard with NO PROBLEM.ģ. I think something has changed in the CPU clocking. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |