
Originally Posted by
The Master
Oh, I thought it might have been simple for a moment there. Since im using 16F i only get 1 hardware UART to play with but im using a MAX485 chip and in the lights the PIC controls the master/slave pins (the 555 method is only used in the main controller). So i can send data to a second chip without it being sent outside the light. I also have 2 spare IO pins so if i use a PIC chip to controll it i can tell it to only listen for serial data if an input pin goes high.
Now i just have to think of something to do with all those extra IO pins on the second chip. I dont think you can get anything with less than 12 and A/E/USART
I've used the 16F688 quite a bit, smallest PIC you can get with a built-in USART as far as I know. And if you set it up right, you should be able to run a load of servo's with it...If you set it up right...
Just a really simple idea off the top of my head...some pseudo-code if you will...
Code:
servo1 var porta.whatever...a lot of servo's...
...serial port setup...
loop:
....check RCREG for new data which is in this format...
bit7 = 1 = new data actually here, =0 nothing really here :)
bit6-bit4 = servo select, one of eight
bit3 = direction
bit2-bit0 = 3 bits to define the amount to move...
...now it gets a bit tricky...depending on clock speed of the PIC
...do the same thing with the servo's that you did with the LEDs, except the servos are on for XXX microseconds, and off for about 18ms or so...
goto loop
Bookmarks