the tini has a bunch of serial ports. some internal. some external. i don't really know what the difference is. i just know that serial0 goes to one of the db9 connectors and serial4 goes to the other. serial0 is a male connector wired as a DCE (Data Communications Equipment) and serial4 is a female connecter wired as a DTE (Data Terminal Equipment).
serial0 is typically used for loading the firmware into the tini. you basically plug it into your serial port and do some terminal action. however, once you are done, you don't really need to plug it into anything anymore. what you want to do.. (me at least) is plug stuff into the tini. that means it needs to be the host or the DTE. fortunately that is easy enough to do. i just needed to make a cross-over cable. here is a fine page for wiring such things up.. http://www.bb-elec.com/tech_articles/FAQ_rs232_connections_work.asp
ok. that's nice. so i can now put my servo controller on either port. i want to plug in my accelerometer. from my snooping of the stupid accelerometer protocol it sets the RTS and DTR pins high. problem is according to some random pages on tini i came across, those are not supported on serial4 for some lame reason.
3 hour story short.. i tried on serial0. failed. i tried on serial4. failed. i tried serial4. success. crap. apparently newer versions of tini do support the rts/dts pins?
i'm just feeding the xaxis directly into the servo with some scale and bias. i need some atan action (probably tabled) to do it right, but i'll do that another day. i also need to do some smoothing because it is really noisy. that might be because i have some serious RF action going on somewhere. the 900Mhz baby monitor really does not like playing well with my toys. i wonder if i am fucking up peoples phones or wireless? i doubt it has the power, but i hope not.
so next i am going to build the joint between the servos and put all these electronics in cases so i don't break them. soon i'll have an auto-coffee-cup leveling system. accls. just what everyone always wanted.