Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { // -------- Start LED------- // The LED can be manipulated using the calls in led.h // To turn the LED on:- LED_on(&led); // Output to hardware serial port rprintfInit(&huartSendByte); rprintf("#0P1500T100\r"); // Output to Software serial port rprintfInit(&suartSendByte); rprintf("#0P1500T100\r"); // To turn the LED off:- LED_off(&led); // -------- End LED------- return 0;}
At 38400bps, you are asking a regular digital I/O pin to change state at a rate of 78600Hz, at a resolution *much* higher than that - a lot!
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { // -------- Start LED------- // The LED can be manipulated using the calls in led.h // To turn the LED on:- LED_on(&led); // Output to Software serial port rprintfInit(&suartSendByte); rprintf("#0P1500T100\r"); while (uartIsBusy(suart)) ; // To turn the LED off:- LED_off(&led); // -------- End LED------- return 100000;}
Did you ever try 4800bps?
void __uartswStartXmit(UART* _uart, uint8_t data){ SW_UART* uart = (SW_UART*)_uart; // save data uart->txData = (uart->inverted) ? ~data : data; // set number of bits (+1 for stop bit) uart->txBitNum = 9; const Timer* timer = &pgm_Timers[uart->timer]; // Get current time - 100 clock cycles otherwise the start bit is too long uint16_t start = timerGetCounter(timer) - 100;...
But if he decides to use the software serial port for the SSC-32, the only valid baud rates are: 115200,38400, 9600, 2400... So the next one down would be 2400 baud and that is pretty darn slow
Yet another reason I'd put the software uart on bluetooth and not the servo controller
uint16_t start = timerGetCounter(timer) - 100;
// Get current time - 100 clock cycles otherwise the start bit is too long uint16_t start = timerGetCounter(timer) - 100;
@KurtEck - Thanks for all the timing stuff. Very useful. Unfortunately I don't have a logic analyzer so I have to work blind until something works. Not easy ! The hard stuff is that the calls to set the next timer compare value have to go through the library which are a bit bloated compared with just writing the register directly. Equally the interrupt handlers end up pushing/popping lots of registers. This all adds overhead. ...
The last time I used it was when the sparkfun Regulated explorer was not working with the Axon2 and I found the low voltage was not low enough...
QuoteThe last time I used it was when the sparkfun Regulated explorer was not working with the Axon2 and I found the low voltage was not low enough... You mean the voltage coming out the regulator was too low, or going in from the Axon was too high?