bit banged spi slave

beny1949

Senior Member
Hello all,

i am attempting to creat a micro mouse at the moment, and i am using 08M slaves to drive some servo motors, and hopefully a 40X1 or 2 and the main processor.

I have seen that when using the servo command it is not possible to use serin or pulsin. this makes it quite difficult to get data to the 08Ms. I was thinking that i could use a bit banged spi, but i dont really know how to go about coding it.

i was going to use input 3 and 4 on the 08m and not sure what outputs on the 40X? yet.

Any help would be appricated

Ben

 
 

BeanieBots

Moderator
If you are planning to wait and use the 40X1, why do you need the 08M slaves? I can't see how they would help.
There will be more than enough program space for a micromouse controller and more than enough I/O to control a six wheel independant drive mouse with indicators, headlights, retractable sun-roof, heated seats, DVD player and sat-nav!
You'll even have the choice of fast hardware SPI or I2C for external memory for maze mapping.
 

Bloody-orc

Senior Member
If you want to use those slave 08M's so much, then just use Serout and Serin commands + one address/data line.

I'll give you an example using 40X and 2 08M's:

40X serial out is connected via small (180 ohm) resistors to both 08M's (one resistor to both 08M's). If needed then same for Serial in only you have to make up a way to make sure those 08M's won't start talking to the master at the same time. easiest way to overcome that is to let Master decide, who will talk and it just sends out commands like "Slave1 send me this info" etc. and then one digital output of the master is connected to 08M's inputs via those resistors again. pull this line high so the slaves know, that the next byte is address (name of the slave). if it's low then only the chip who needs the data will read it. all others may do their own stuff meanwhile (make servo pulses, read sensors or whatever).

So you get 2 (or 3 if sein is also used for master) Y connections on the PCB.

Let me know if you need clarification or something... This is actually why "god" in the Atmel factory "invented" 9 bit serial ;) a whole lot less connections and less hacking ;)
 

beny1949

Senior Member
Looks like i got the wrong end of the stick!!!

so can you use more than one servo on one pixaxe?

Edited by - beny1949 on 22/04/2007 20:13:06
 

Bloody-orc

Senior Member
of course! I think 8 is minimum for big picaxes. one to each pin. I don't think, that they have made SERVO C0,150 yet to control servos on PORTC...
 

beny1949

Senior Member
ok, thank you very much! this makes everything a whole lot more simple!

i can actually just get on with it now!

Ben

 
 

Wrenow

Senior Member
Ben,

check out the little AXE024 08M servo controller board - controls 3 servos, and the circuitry is already designed nicely for you. And you have access to the other pins.

I am using two of the servo outputs and another pin as rodio control PPM signal inputs to determine the signal for the servo output that is left. These are a really good starting point for a simple robot. The 21 servo controller board is nice as well, but I haven't even dusted mine off yet (though I have one for when I need it).

Wreno
 
Top