# serial communication

**URL:** <https://forums.digi.com/t/serial-communication/10335>\
**Category:** Rabbit\
**Created:** [June 22, 2009, 8:20pm UTC](https://forums.digi.com/t/serial-communication/10335 "2009-06-22T20:20:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahua](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@ahua](https://forums.digi.com/u/ahua)\
**Post date:** [June 22, 2009, 8:20pm UTC](https://forums.digi.com/t/serial-communication/10335/1 "2009-06-22T20:20:36Z")

</div>

Hello I’m a new user to Dynamic C. I’m programming on an RCM3200 and trying to transmit data back and forth with a computer and the Wolf BL2600.

I have successfully echoed characters back and forth, but once I change the character to be sent back to the computer to something different from what the computer sent the BL2600, I get the error  
“While Debugging: Timeout while waiting for response from target”

Also, I get Bad Packet errors when trying to use the sample programs of serXwrite() and serXputs().

I am trying to transmit sensor data back to a GUI on the computer, which is of float data type, but since using serXwrite failed every time I tried, I converted the float into a string and tried to transmit the data character by character using serXputc(). However, the same error quoted above popped up.

Does anyone have any suggestions? Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![sgt](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@sgt](https://forums.digi.com/u/sgt)\
**Post date:** [June 23, 2009, 12:33am UTC](https://forums.digi.com/t/serial-communication/10335/2 "2009-06-23T00:33:04Z")

</div>

I think I have seen this error (“While Debugging: Timeout while waiting for response from target”) when I tried to use one of the I/O pins that the programming port needed for something else. Not sure why it would work sometimes and not tothers though, if that’s what’s going on here… Anyway, what serial port are you using on each computer to send & receive the data? And how is the sensor connected?

---

<div class="post-metadata">

**Author:** ![ahua](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@ahua](https://forums.digi.com/u/ahua)\
**Post date:** [June 23, 2009, 2:11pm UTC](https://forums.digi.com/t/serial-communication/10335/3 "2009-06-23T14:11:47Z")

</div>

I am using Serial Port A(the programming port), and the sensor is a thermistor connected to the analog inputs.

Something I found out-  
Using serXgetc(), I get the character ‘s’ as an ascii integer. If I set it to a variable, say int c;, and call the function serXputc(c) with it, everything will work fine. Also, if I get int c; and set some\_other\_variable = c, and then pass the other variable into serXputc(some\_other\_variable), everything will still work fine. However, if I just try using serXputc(‘s’) or try changing the value of int c then I get the debug error.

Any suggestions, maybe if Dynamic C has a certain way of calling characters (maybe not with single quotes??)?

---

<div class="post-metadata">

**Author:** ![kobuseng](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kobuseng](https://forums.digi.com/u/kobuseng)\
**Post date:** [June 23, 2009, 2:38pm UTC](https://forums.digi.com/t/serial-communication/10335/4 "2009-06-23T14:38:57Z")

</div>

As far as I am aware you cannot use serial port A and the debugger at the same time.  
Also as a general hint, try not to use serial port A, but rather another port. There seems to be a issue where the rabbit can enter a permanent stall state (unrecoverable from even with a power cycle).

---

<div class="post-metadata">

**Author:** ![ahua](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@ahua](https://forums.digi.com/u/ahua)\
**Post date:** [June 23, 2009, 3:59pm UTC](https://forums.digi.com/t/serial-communication/10335/5 "2009-06-23T15:59:10Z")

</div>

Thank you very much! This seems to have fixed the debug error problems.

I know this is a really rudimentary question, but physically speaking, where are the other Serial ports such as serial port B located on the BL2600? Do I use the wider programming cable to connect to the other serial ports?
