Serial bug ...... I think

02 Mar 2011

Hello: This is also a follow up to another post that received no hits. Since then I have some additional information.

I have generated an interrupt off of COM_1314 that looks like:

void COM_1314RxInterrupt(void) { int c = COM_1314.getc(); if (isprint(c)) { COM_2728.printf("We have just read '%c'\r\n",c); } else { COM_2728.printf("We have just read '0x%02X'\r\n",c); } }

(Sorry, I am not sure how to display this as readable code in this forum)

The code works as expected for all *characters*. Essentially I am TerraTerming in on COM_1314 (using my keyboard) and echoing out COM_2728 to see the result.

Where the problem occurs is when I enter in non-ascii code -> the interrupt echos nothing. To try and see what is going on I enter in the ASCII codes on COM_1314 ( ie. ALT-100 -> echos with a 'd')

As before, all ASCII codes up to and including ALT-127 work.

At ALT-128 ('Ç' - the first non-ascii character) the code will respond with TWO!! hex numbers (for a single getc()). Those single numbers are ( 0xC2 and 0xA6) when the other TeraTerm gets this information, it does not know what to do so it simply displayed nothing.

Unfortunately this is a requirement for my program. I need to take non-ASCII data from the serial port and spit it out of the CAN bus. I am unable to do that since I cannot read with any sort of clarity what these two hex values mean.

Can anyone shed a bit of light on this? Is there another ASCII table that consists of two hex values for extended ascii that I am not aware of?

Thank you in advance for your brains.

03 Mar 2011

How is TeraTerm supposed to print nonprintable characters?

Try changing your line:-

  if (isprint(c)) { 
    COM_2728.printf("We have just read '%c'\r\n",c); 
  } 
  else { 
    COM_2728.printf("We have just read '0x%02X'\r\n",c); 
  }

simply to:-

  COM_2728.printf("We have just read [%02x] '%c'\r\n", c, c); 

That way you'll see if a real value is there by printing it's hex value as well as it's printable value.

Also, when posting code snippets in this forum, surround the snippet with <<code>> ... <</code>> to make it easier to read please :)

03 Mar 2011

This may be operating as expected, if Tera Term is set to enable UTF-8 encoding.

In UTF-8 encoding, ASCII codes above 0x80 translate into two bytes, starting with 0xC2 0xA0. See, for example, the explanation at http://www.ietf.org/rfc/rfc2279.txt.

Fiddling with your Tera Term settings should clear things up. See http://ttssh2.sourceforge.jp/manual/en/usage/unicode.html for some (possibly) helpful info.

04 Mar 2011

Got it! Thanks for the help with that.

10 Mar 2011

So. After a few more days of pondering this is what I have resorted to:

A very simple program that just echos data from one serial port to a different one. What I have shown is that all of the data is NOT getting through.

Test set up: Take two radios with the identical data output serially at 38400. One of the outputs goes directly into TerraTerm, the other goes through my program. The data sets should be identical, but they are not. The MBED is dropping data.

AA 44 12 1C 0A 00 02 60 4D 00 00 00 8E B4 5A 06 30 99 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 4D 46 14 4E C0 80 CA 03 14 43 66 FF 16 04 14 06 17 7F 05 FE 17 09 65 C0 4F 03 14 53 76 40 4B 03 14 0B 8B 00 D1 03 14 E0 0D 00 C5 02 14 96 AB 40 8D 04 14 D8 82 00 40 04 14 1B 09 40 40 05 14 D2 83 00 49 04 14 50 85 5C 57 E1 48 2F AA 44 12 1C 5B 01 02 60 69 00 00 00 87 B4 5A 06 18 9D E1 18 00 00 10 00 69 D8 12 07 99 30 0C C3 07 69 4E 52 D3 2F 4F A6 8B 09 68 87 E1 A6 96 90 00 4E BB A8 8F 6D 39 16 D3 F9 1F B5 E0 2D 65 F4 00 FF DF F0 6A 75 8B 09 68 87 E2 29 2D FD 11 34 20 70 18 F9 81 FD 9B 03 9F 43 E4 0D 28 A1 0D 01 FA 65 F4 7C 8B 09 68 87 E2 AF FF B7 ED 7B E5 89 00 0E 27 0F B3 3D 20 21 FF 7D 33 3C FF A7 C3 2D 00 66 9B 3C C1 10 BF 15 4B AA 44 12 1C 0B 00 02 60 18 00 00 00 87 B4 5A 06 18 9D E1 18 00 00 10 00 DE 44 12 07 99 30 0C C3 07 18 4E 02 79 18 3F B7 D2 88 52 6B 22 61 F9 28 D0 EB C3 68 AA DD 71 14 AA 44 12 1C 0A 00 02 60 4D 00 00 00 87 B4 5A 06 00 A1 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 4D 50 14 4E C0 80 8A 01 14 03 66 FF 56 00 14 86 16 7F C5 FB 17 09 65 C0 8F 01 14 53 76 40 8B 01 14 4B 8B 00 11 01 14 E0 0D 00 45 02 14 56 AB 40 8D 01 14 58 82 00 80 01 14 1B 0A 40 40 03 14 92 83 00 C9 01 14 1C 24 87 BE B5 86 22 AA 44 12 1C 0A 00 02 60 4D 00 00 00 87 B4 5A 06 D0 A8 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 4D 5A 14 4E C0 80 4A FF 17 03 66 FF 96 FE 17 06 16 7F 85 F8 17 09 65 C0 4F FF 17 53 76 40 8B FF 17 4B 8B 00 D1 FF 17 E0 0D 00 45 FF 17 16 AB 40 8D FF 17 D8 81 00 C0 FF 17 5B 0B 40 80 FC 17 52 83 00 C9 FF 17 DB CE A9 C6 75 36 57 AA 44 12 1C 0A 00 02 60 47 00 00 00 8F B4 5A 06 A0 B0 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 47 64 14 CE C0 80 0A 05 14 03 66 FF 96 04 14 C6 15 7F 45 FE 17 49 65 C0 8F 04 14 D3 76 40 8B 05 14 0B 8C 00 11 05 14 20 0E 00 05 05 14 56 AB 40 0D 05 14 D8 81 00 00 05 14 92 83 00 89 05 14 B3 91 F1 DD 82 CE 51 AA 44 12 1C 0B 00 02 60 18 00 00 00 87 B4 5A 06 A0 B0 E1 18 00 00 10 00 DE 44 12 07 99 30 0C C3 07 18 4E 02 79 18 3F B7 D2 88 52 6B 22 61 F9 28 D0 EB C3 68 3C AA 19 E9 AA 44 12 1C 0A 00 02 60 47 00 00 00 8F B4 5A 06 70 B8 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 47 6E 14 CE C0 80 8A FF 17 83 65 FF D6 FE 17 06 15 7F 85 F9 17 C9 64 C0 CF FE 17 D3 76 40 4B FF 17 CB 8B 00 91 FF 17 20 0E 00 85 FF 17 16 AB 40 8D FF 17 58 81 00 00 00 14 12 83 00 C9 FF 17 65 83 D0 CE 6F A0 B8 AA 44 12 1C 0A 00 02 60 47 00 00 00 8E B4 5A 06 40 C0 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 47 78 14 CE C0 80 4A FF 17 43 65 FF 16 FE 17 46 14 7F 85 F7 17 C9 64 C0 0F FF 17 D3 76 40 8B FF 17 0B 8C 00 51 FF 17 E0 0D 00 C5 FE 17 D6 AA 40 0D FF 17 18 81 00 80 FE 17 D2 82 00 49 FF 17 54 0E 52 D4 B3 CF F3 AA 44 12 1C 5B 01 02 60 69 00 00 00 87 B4 5A 06 40 C0 E1 18 00 00 10 00 69 D8 12 07 99 30 0C C3 07 69 4E 52 D3 2F 54 30 8B 09 68 87 E1 A6 96 90 00 4E BB A8 8F 6D 39 16 D3 F9 1F B5 FD 00 65 F3 00 00 1D 30 C9 02 8B 09 68 87 E2 29 00 00 EC 33 DA 41 85 8F D0 00 B5 03 07 11 EA 14 8F A1 0D D1 30 65 F3 23 8B 09 68 87 E2 AF 00 0E 16 F2 0A 63 00 29 26 A8 7D A5 16 FB F3 9E 3A B2 FF A8 6B 00 F4 12 77 2F 10 7C 8E 6F 26 AA 44 12 1C 0B 00 02 60 18 00 00 00 8E B4 5A 06 28 C4 E1 18 00 00 10 00 DE 44 12 07 99 30 0C C3 07 18 4E 02 79 18 3F B7 D2 88 52 6B 22 61 F9 28 D0 EB C3 68 5C 8B 4D 97 AA 44 12 1C 0A 00 02 60 47 00 00 00 8F B4 5A 06 10 C8 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 47 82 14 0E C1 80 0A 05 14 03 65 FF 16 05 14 46 14 7F 05 FF 17 C9 64 C0 8F 04 14 13 77 40 8B 04 14 8B 8C 00 91 04 14 20 0E 00 85 04 14 16 AB 40 0D 05 14 18 81 00 C0 04 14 D2 82 00 09 05 14 76 8F 34 C9 0E 36 C9 AA 44 12 1C 0A 00 02 60 47 00 00 00 86 B4 5A 06 E0 CF E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 47 8C 14 0E C1 80 0A 00 14 03 65 FF 56 FF 17 C6 13 7F C5 F9 17 09 65 C0 CF FF 17 D3 76 40 0B 00 14 8B 8C 00 51 00 14 60 0E 00 85 00 14 D6 AA 40 CD FF 17 58 80 00 80 FF 17 52 82 00 49 00 14 83 E0 F4 70 D1 3A 82 01 01 02 02 74 74 00 00 6C 00 00 00 00 F2 74 00 12 ED 7F DC 40 0B B5 41 45 01 AD F1 0A EC CA 86 E7 6F 16 10 00 00 00 00 00 00 

The same data set run through this program:

#include "mbed.h"

DigitalOut myled(LED1);

//void COM_2728_receive(void);
void COM_1314_RxInterrupt(void);
Serial COM_2728(p28, p27); // tx, rx COMS for diagnostics
Serial COM_1314(p13, p14); // tx, rx COMS for diagnostics


int main() {


COM_2728.baud(38400);
COM_1314.baud(38400);
COM_1314.attach(&COM_1314_RxInterrupt);    

    while(1) 
    {
        
    }
}

void COM_1314_RxInterrupt(void)
{

    char c = 0;
    c = COM_1314.getc();
    COM_2728.printf("%02X, ",c);
}




Results in this data set

AA 44 12 1C 0A 00 02 60 4D 00 00 00 8E B4 5A 06 30 99 E1 18 00 00 10 00 6B 60 12 07 99 30 04 46 C0 CA 43 FF 14 7F FE 65 4F 53 4B 14 00 03 0D C5 96 8D 14 00 04 09 40 D2 49 14 85 E1 2F AA 44 12 1C 5B 01 02 60 69 00 00 00 87 B4 5A 06 18 9D E1 18 00 00 10 00 69 D8 12 07 99 30 07 4E 2F A6 68 A6 90 BB 8F 16 F9 E0 F4 FF 6A 8B 87 2D 11 70 F9 9B 9F 0D 0D FA 7C 09 E2 FF 7B 89 27 B3 21 33 FF 2D 66 C1 15 AA 1C 00 18 00 B4 18 E1 00 00 12 30 C3 4E 79 B7 88 22 28 EB AA 71 AA 44 12 1C 0A 00 02 60 4D 00 00 00 87 B4 5A 06 00 A1 E1 18 00 00 10 00 6B 60 12 07 99 30 04 14 C0 01 03 56 14 7F FB 65 8F 53 8B 4B 00 14 0D 02 56 8D 14 00 01 0A 03 92 C9 14 87 B5 AA 44 12 1C 0A 00 02 60 4D 00 00 00 87 B4 5A 06 D0 A8 E1 18 00 00 10 00 6B 60 12 07 99 30 04 14 C0 4A 03 96 17 7F F8 65 4F 53 8B 4B 00 FF 0D FF 16 8D 17 00 FF 0B FC 52 C9 17 A9 75 AA 44 12 1C 0A 00 02 60 47 00 00 00 8F B4 5A 06 A0 B0 E1 18 00 00 10 00 6B 60 12 07 99 30 C3 47 CE 0A 14 FF 04 15 45 49 8F D3 40 05 8C 05 20 05 14 40 05 81 05 92 89 14 F1 CE AA 12 00 18 00 B4 06 E1 00 00 12 99 C3 18 79 3F 88 22 F9 EB 68 19 AA 44 12 1C 0A 00 02 60 47 00 00 00 8F B4 5A 06 70 B8 E1 18 00 00 10 00 6B 60 12 07 99 30 04 6E C0 8A 83 D6 17 7F F9 64 FE D3 4B 17 00 FF 0E FF 16 8D 17 00 14 83 FF 65 CE A0 AA 44 12 1C 0A 00 02 60 47 00 00 00 8E B4 5A 06 40 C0 E1 18 00 00 10 00 6B 60 12 07 99 30 C3 78 C0 FF 43 FF 17 7F F7 64 0F D3 40 17 00 FF 0D C5 D6 0D 17 00 FE 82 49 54 D4 CF AA 1C 02 69 00 5A 40 E1 00 69 12 30 C3 4E 2F 30 68 E1 90 4E 8F 16 F9 FD 65 00 C9 8B 87 29 EC DA 8F B5 07 14 A1 30 F3 09 E2 00 16 63 26 7D FB 9E FF 00 12 10 8E AA 44 12 1C 0B 00 02 60 18 00 00 00 8E B4 5A 06 28 C4 E1 18 00 00 10 00 DE 44 12 07 99 30 C3 4E 79 B7 88 22 28 EB 5C 4D AA 44 12 1C 0A 00 02 60 47 00 00 00 8F B4 5A 06 10 C8 E1 18 00 00 10 00 6B 60 12 07 99 0C 04 82 C1 05 03 16 14 7F FF 64 04 13 8B 14 00 04 0E 04 16 0D 14 00 14 82 05 8F C9 36 AA 44 12 1C 0A 00 02 60 47 00 00 00 86 B4 5A 06 E0 CF E1 18 00 00 10 00 6B 60 12 07 99 30 C3 8C 0E 0A 03 FF FF 13 F9 09 CF 17 40 14 8C 00 0E 85 14 40 17 80 FF 52 49 14 F4 3A 01 01 02 02 74 74 00 00 6C 00 00 00 00 F2 74 00 12 ED 7F DC 40 0B B5 41 45 01 AD F1 0A EC E7 16 00 00 00 08 FF FF FF 00 DD B5 00 00 02 00 0D 87 00 75 64 69 65 75 64 69 64 30 30 03 AA 44 12 1C 0A 00 02 60 47 00 00 00 90 B4 5A 06 B0 D7 E1 18 00 00 10 00 6B 60 12 07 99 30 04 96 C1 0A C3 96 17 7F 17 65 4F 13 CB 17 00 00 0E 85 D6 CD 17 00 FF 82 FF 25 74 F8 44 1C 02 18 00 5A B0 18 00 DE 12 30 07 4E 18 B7 52 22 28 C3 67 DF AA 44 12 1C 0A 00 02 60 47 00 00 00 90 B4 5A 06 80 DF E1 18 00 00 10 00 6B 60 12 07 99 30 04 A0 C1 0A 03 16 17 7F F9 65 4F 13 0B 14 00 00 0F 85 D6 0D 18 00 00 81 00 4A DC 5E AA 44 12 1C 5B 01 02 60 69 00 00 00 86 B4 5A 06 68 E3 E1 18 00 00 10 00 69 D8 12 07 99 30 07 4E 2F BA 68 A1 90 BB 8F 16 F9 ED 32 00 15 8B 84 A8 CE D5 A7 52 5E 0D A1 0B 7C 09 84 FF 9D E7 27 78 01 68 FF 56 4D BC 81 AA 44 12 1C 0A 00 02 60 47 00 00 00 8B B4 5A 06 50 E7 E1 18 00 00 10 00 6B 60 12 07 99 30 04 AA C1 00 C3 16 86 7F F9 65 FF 93 4B 14 00 00 0F 00 AA 8D D8 00 17 81 FF 55 92 25 AA 44 12 1C 0B 00 02 60 18 00 00 00 8B B4 5A 06 38 EB E1 18 00 00 10 00 DE 44 12 07 99 30 07 4E 18 D2 52 22 28 C3 B0 5F AA 44 12 1C 0A 00 02 60 47 00 00 00 8B B4 5A 06 20 EF E1 18 00 00 10 00 6B 60 12 07 99 30 04 B4 C1 CA 03 FF 17 7F F9 65 8F D3 0B 14 00 00 10 45 D6 CD 14 00 00 81 00 40 19 78 AA 44 12 1C 0A 00 02 60 47 00 00 00 8E B4 5A 06 F0 F6 E1 18 00 00 10 00 6B 60 12 07 99 30 C3 47 CE 4A 14 FF 05 10 00 09 CF 14 40 05 8D 05 20 05 14 40 05 7F 06 52 89 14 A4 DA AA 44 12 1C 0A 00 02 60 47 00 00 

What can be seen is that I am dropping data and I have NO idea why this is occurring. I am dropping. If I compare the two:

This is what I get:

MBED	AA 44 12 1C 0A 00 02 60 4D 00 00 00 8E B4 5A 06 30 99 E1 18 00 00 10 00 6B 60 12 07 99 30 04 46 C0 CA 43 FF 14 7F FE 65 4F 53 4B 14 00 03 0D C5 96 8D 14 00 04 09 40 D2 49 14 85 E1 2F AA 44 12 1C 5B 01 02 60 69 
RADIO	AA 44 12 1C 0A 00 02 60 4D 00 00 00 8E B4 5A 06 30 99 E1 18 00 00 10 00 6B 60 12 07 99 30 0C C3 04 4D 46 14 4E C0 80 CA 03 14 43 66 FF 16 04 14 06 17 7F 05 FE 17 09 65 C0 4F 03 14 53 76 40 4B 03 14 0B 8B A1 52 

For some reason, the Rx buffer is not generating an interrupt for this data and I loose it or I am doing something else fundamentally incorrect. Hopefully someone is able to shed some light on this problem. It drops about 1/2 of the data if I look at the log files from TerraTerm on the output. (21kb vs 42kb)

I am not sure if this has to do with the UTM-8 or anything. Quite lost here and hopefully someone can make sense of it.

Thank you in advance for your brains.

Steve

10 Mar 2011

Additional notes:

I notice that I start losing data at 32 bytes......what an odd number......any chance there is a buffer that is being filled up faster than I can empty?

10 Mar 2011

You could try doubling the debug port speed. After all, the time it takes to jump into ISR + read from tx register, and then write to tx registor is greater than tx cycle time.

Enjoy Ceri.

10 Mar 2011

The UART buffer is 16 bytes, so that sounds like a good candidate. You really shouldn't printf in an interrupt handler.

10 Mar 2011

Thank you both for your comments:

I am not sure what you mean by doubling the debug port speed.

Igor: I agree that I should not printf in an interrupt handler however I was attempting to debug my existing code that exhibits the same errors.

That code looks like:

void COM_1314_RxInterrupt(void)  
// recieve corrections data on COM_1314 and send it back out on CAN bus

{

    char DataToSend[3];
    DataToSend[0] = CORRECTIONS_DATA;
    DataToSend[1] = COM_1314.getc();
    DataToSend[2] = TestCounter;
    can2.write(CANMessage(CANID, (char*)& DataToSend[0], 3, CANData, CANExtended));        



}

As you can see, this code does not have a printf in it yet it results in the exact same data output. I would hasten to guess that since this is the only printf in the test code with a processor at this speed would not cause any problems.

Additionally, if I take an entire Chapter of Alice in Wonderland and put it into one TerraTerm window it replicates EXACTLY through my MBED code. (even with the printf)

So, the problem seems to be arising with the non-standard ASCII characters, the MBED is simply not recognizing that they are a real value. It does not seem to be a problem with my code, nor the speed of the processor, rather with the non-standard characters that are seen in a binary corrections file.

11 Mar 2011

For sending non-standard characters found in binary files you have to convert those files in hex format. This is the purpose of hex files.

Titi

11 Mar 2011

Try importing MODSERIAL into your project and changing:-

#include "mbed.h"
#include "MODSERIAL.h"

DigitalOut myled(LED1);

MODSERIAL COM_2728(p28, p27); // tx, rx COMS for diagnostics
MODSERIAL COM_1314(p13, p14); // tx, rx COMS for diagnostics

int main() {
    COM_2728.baud(38400);
    COM_1314.baud(38400);
  
    while(1) 
    {
        if (COM_1314.readable()) 
        {
           COM_2728.printf("%02X, ", COM_1314.getc());
        }
    }
}

See if this makes a difference. MODSERIAL buffers data in circular buffers and the above also moves the printf() into your main while(1) user context (out of the interrupt). Can you let us know how you get on.

Import libraryMODSERIAL

Bug fix release

11 Mar 2011

Hi Andy:

Thanks for your suggestion.

I have attempted to do what you say and have ended up with corrupt data as well.

More to follow as I unearth other facts.....stay tuned for exciting data......

11 Mar 2011

So.

Here is the code that I implemented, just for kicks, I even slowed down the rate of data to 9600 baud. Now the Mbed outputs more data than it receives.

#include "mbed.h"
#include "MODSERIAL.h"

DigitalOut myled(LED1);

MODSERIAL COM_2728(p28, p27); // tx, rx COMS for diagnostics
MODSERIAL COM_1314(p13, p14); // tx, rx COMS for diagnostics
CAN can2(p30, p29);


int main() {
    COM_2728.baud(9600);
    COM_1314.baud(9600);
  
    while(1) 
    {
        if (COM_1314.readable()) 
        {
           COM_2728.printf("%02X ", COM_1314.getc());
        }
    }
}
<<code/>>

And the corresponding data -> works good for a little bit then slowly looses its mind.

<<code>>
From MBED	1	1	2	2	74	74	0	0	6C	0	0	0	0	D5	74	0	3A	92	7	C7	A2	0C	B5	41	45	1	AD	F1	0A	EC	CA	86	E7	6F	16	10	0	0	0	0	0	0	0	0E	0A	0A	0	FF	FF	FF	FF	FF	FF	8	0	0	0	C8	A2	0C	B5	41	0	0	0	0	0	0	2	0	0	0	0	0D	FE	83	0	0	0	0	9	75	6E	64	65	66	69	6E	65	64	9	75	6E	64	65	66	69	6E	65	64	5	30	2E	30	30	30	3	0D	AA	44	12	1C	5B	1	2	60	69	0	0	0	8C	B4	5A	6	A8	55	48	1E	0	0	10	0	69	D8	12	7	99	30	0C	C3	7	69	4E	52	D3	E0	4C	A6	8B	9	68	A5	3C	A6	96	90	0	42	89	BC	CF	AA	91	FB	D3	C9	AE	50	E0	49	7C	CE	0	FF	DF	F0	5E	B9	8B	9	68	A5	3D	28	49	FD	86	33	2C	9C
From Radio	1	1	2	2	74	74	0	0	6C	0	0	0	0	D5	74	0	3A	92	7	C7	A2	0C	B5	41	45	1	AD	F1	0A	EC	CA	86	E7	6F	16	10	0	0	0	0	0	0	0	0E	0A	0A	0	FF	FF	FF	FF	FF	FF	8	0	0	0	C8	A2	0C	B5	41	0	0	0	0	0	0	2	0	0	0	0	0D	FE	83	0	0	0	0	9	75	6E	64	65	66	69	6E	65	64	9	75	6E	64	65	66	69	6E	65	64	5	30	2E	30	30	30	3	0D	AA	44	12	1C	0A	0	2	60	47	0	0	0	8A	B4	5A	6	30	69	48	1E	0	0	10	0	6B	60	12	7	99	30	0C	C3	4	47	6	9	8B	71	40	51	FE	17	D1	C6	3F	CE	FE	17	8E	86	80	89	FE	17	20	6F	80	17	FE	17	1F	5B	40	0C	FE	17	4C	2	0	42	FE	17	99	C8	3F	96	FF	17	94	1C	40	C9

I think that my next step is to rip it all out and go to low level coding. All I have is a Rowley Crossworks complier and I do not know if I can drop a bin file in the MBED and it will work.

Any suggestions are appreciated. I have no idea why I am seeing any of this.......

11 Mar 2011

Additional notes:

I have swapped radios port for port to ensure that I was not in injecting 'noise' via hardware. The same symptoms persist even when switching hardware so that rules out hardware.

Once again, this program works as intended when reading characters like the entire chapter of Alice in Wonderland.....it only exhibits this strange behavior when binary is being transmitted.

Just for kicks...I am going to transmit Alice in Wonderland over the air to both radios to see if that causes any grief. I think that this will be my last experiment before throwing in the towel today....

11 Mar 2011

The only thing I can suggest is removing the radios and hard wiring the ports together. I'm pretty sure Mbed isn't loosing them. I have lots of experience with the serial uarts and never seen a missed byte yet.

12 Mar 2011

Steve -

I have seen some odd things like this when the source and destination have slightly mismatched serial parameters or incomplete handshaking.

Some things to check:

  • Do the radios require RTS/CTS or DTR/DSR hardware signals? If so, you'll need to jumper things so the radio thinks it can send at will. Look for info on null modems to see how to haywire this...
  • What are the radio specs for data length, stopbits, and parity? Are these matched exactly by the mbed?
  • Is software handshake turned off in TeraTerm? If not, binary data might trigger some unexpected behavior.
14 Mar 2011

Thanks again guys I will check this out.

Once again, what I find very odd is I can send tons of text through this program and it works fine -> I don't drop anything. That changes when I switch to a binary input stream though. I have cut and pasted 1000's of characters with no problem.

I will check the hardware signals on both my radios and TeraTerm however if characters are transmitted correctly, I am not sure that this will lead anywhere -> it only seems to cause problems with the binary -> strange. I will keep you all posted as I unravel this mystery.....