Go Down

Topic: Serial write to an LCD causes motors on PWM to twitch. (Read 1 time) previous topic - next topic

liudr

Try this:

Disconnect the serial LCD, but still run the program, at high software serial baud rate. This makes arduino output to software serial fast but you're not messing up your display. If at say 38400 or 57600 you stop seeing twitching then you need a serial LCD that can work that fast. Parallax lcd is not so fast.

MarkT

A somewhat devious suggestion:  clone a copy of SoftwareSerial, call it mySoftwareSerial or similar, and remove all the interrupt
disabling code from it.  It would only work reliably at lower baud rates, but wouldn't then interfere with the Servo library....

The code disabling/reenabling interrupts looks like this:
Code: [Select]

    uint8_t oldSREG = SREG;
    cli();
    ...
    SREG = oldSREG;


all you really need to do is comment-out the "cli();" lines...
[ I won't respond to messages, use the forum please ]

Go Up