Dual Network Nodes! (Final Project R&D)

My final project is going to be made of a "large" network of processors (i.e. 10 or so) on a single board, and each of those processors will have the possibility of having other processors attached to them in a way that only they can see. In other words, each processor would be on one common network, but would also support their own private message network.

This week, in addition to just getting a single network up and running, I wanted to explore that concept. I re-used some of the programming pins for my second set of TX/RX, which meant I could "plug in" nodes by connecting to the ISP pins.

Node Types

I milled several types of node, although I was only able to code up three of them:

I was able to mill all three (Controller and Message nodes are physically the same right now, although that will soon change). I got my network to work, and I even got my trigger / controller interaction up and running. Unfortunately it all stopped there for this week because.....

Strings! Egads!

My nodes pass dynamic messages back and forth, so I need to be able to dynamically send strings. Unfortunately, this is apparently not a simple matter of looping through the characters in a string and put_char-ing them.

Here's what I tried, and these strings aren't even dynamic! (sort of pseudocode, I'm not copying from my code base):

				char * str = "test";
				char chr;
				int i = 0;
				for(i = 0; i <4 ; ++i) {
					chr = str[i];
					put_char(*port,pin,chr);
				}
				
				^ Yields "ÿÿÿÿ"
				
				------------------------------
								
				char * str = "test";
				char chr;
				int i = 0;
				for(i = 0; i <4 ; ++i) {
					chr = str[2];
					put_char(*port,pin,chr);
				}
				
				^ Yields "ssss"
				
				------------------------------
								
				char * str = "test";
				char chr;
				int i = 0;
				int x = 2;
				for(i = 0; i <4 ; ++i) {
					chr = str[x];
					put_char(*port,pin,chr);
				}
				
				^ Yields "ssss"
				
				------------------------------
				
				char * str = "test";
				char chr;
				int i = 0;
				int x = 0;
				for(i = 0; i <4 ; ++i) {
					chr = str[x];
					put_char(*port,pin,chr);
					++x;
				}
				
				^ Yields "ÿÿÿÿ"
				
				------------------------------
				
				char * str = "test";
				char chr;
				int i = 0;
				int x = 0;
				for(i = 0; i <4 ; ++i) {
					if(x == 0)
						chr = str[0];
					if(x == 1)
						chr = str[1];
					if(x == 2)
						chr = str[2];
					if(x == 3)
						chr = str[3];
					put_char(*port,pin,chr);
					++x;
				}
				
				^ Yields "test"
				
				------------------------------
				
				char * str = "test";
				put_str(*port, pin, str);
				
				^ Yields all SORTS of insanity
			

Anyone? Does anyone have a clue what's up?