|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
BLAH, BLAH
When I cloned the '98 controller (in the clear plastic box), I made up a PIC 16c84 program to do the interfacing with the Tekins, which have the same signal standards as the Victors : Pulse 1 ms +/- 0.5 ms, repeated every 16 ms. Biggest problem was getting the eight serial signals out of the BS2 at the fastest it would go, into the PIC. For only four, just use an interrupt or poll to see when the BS2 wants to send (using SEROUT); blast in the numbers, then start all outputs at the same time, let them stay on for 0.5 ms, then run through the stored numbers, while counting the milliseconds - input number is zero, drop the pin immediately - input number 254, wait until the count has reached 254 before dropping the output (a full millisecond). Wait for the next time BS2 wants to talk. DETAILS - Clock in the BS2 data (which could include a PWM channel number if you want to get picky), and store each in its own cubby hole. - Start all (or just those you want to function) pins high, use TMR0 to count down 500 us, then set TMR0 to count to 1 ms = 1000 us, and set your own counter to zero, and see if channel 'n' is supposed to be '0' : if so, turn it off; if not, skip to test channel 'n+1'. Repeat for all channels, then check that you have a proper length for your loop [each loop represents 1000 ms/128, or 1000 ms/32 if you count by 4's]. Then go back and loop through it all again until they are all off. Wait till TMR0 has finished the 1 ms, and/or wait for BS2. If you count by 4's, then the number you receive from BS2 should be divided by 4 (shift right) so 254 becomes 63. 63 loops will then time out at around 1 ms, or to turn it around, 63 loops through the comparing-and-turning-off loop will take 1000 us. if you counted by 2's, and divided by 2 to start, 127 loops would take 1000 us. Feed this pulse train to your Victor (one Victor / output) and it should work. If you would like, you could use the timer to do two pulse every time the BS2 does a loop (during which it does a SEROUT). MORE INFO No Transmitter Remember, if you write your own program for the BS2, the timing for the BS2 loop comes from the sampling loop in the transmitter: there is one BS2 loop for each data set sent by the transmitter. For a simple program, there is no advantage to using a faster BS2xyz. If you don't have a transmitter, you will have to time your BS2 loop, and adjust as required. Joystick into BS2 via ADC You may want the BS2 to read an ADC (eg ADC0832) as laid out by Parallax, with the joystick being run from Ground to the ADC input, then to a constant current source (LM134?) connected to a higher voltage that the V+ for the ADC. The current should be set at enough to make full resistance give 5V. This is more linear with pot position than Innovation First's circuit by a percent or so: They use the charge-a-cap'r-and-count method, also detailed by Parallax. And No, the Victor does not respond to an analog voltage level, however well filtered your BS2 PWM output may be, on its input. It times out the input pulse, then does its own PWM thing at 12 V. And Yes, the timing values may need adjustments : it's been 5-6 years and three computers since I did the work. |
|
#2
|
|||
|
|||
|
Dear all,
Hello! Everybody, how are your ! I am Kam, a new comer to the world of embedded ! Any one know how to program BS2 using the ADC0832CCN converter ? As I was informed that the BS2 code for ADC0831 and ADC0832 are different. Any advise ? Thank you. Kam |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Battlebots I.Q.- A serious threat to FIRST or a half thought up cheep copy? | Joe Matt | General Forum | 75 | 17-10-2005 20:43 |
| switch speed control | wayne 05 | Programming | 6 | 01-10-2003 09:35 |
| A DEAD reckoning program | rcubes85 | Programming | 5 | 19-03-2003 14:21 |
| last years speed controllers..... | archiver | 2001 | 9 | 23-06-2002 23:44 |
| Speed Controllers | archiver | 2000 | 1 | 23-06-2002 23:01 |