Problem pollSerial

Store Forums Video Experimenter Bugs/Problems Problem pollSerial

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #607
    fanatycoland
    Member

    Hello ,i have a problem with poll Serial , when i receive information on serial communication the word or the sentence is cut and the word is not clear , an example it’s , i sent test and i received te or tes and sometimes all letter.I need help !

    Thx !

    #1620
    Michael
    Keymaster

    What speed are you running pollserial at? I would keep it at a low speed like 9600.

    #1621
    fanatycoland
    Member

    the speed is 9600

    #1622
    Michael
    Keymaster

    maybe try a higher speed, then.

    #1623
    fanatycoland
    Member

    some problem i try speed at 19200 or 115200 and some problem master
    void setup()
    {
    Serial.begin(19200);
    }

    void loop()
    {
    Serial.println(“test”);
    delay(100);
    }

    and slave

    #include
    #include
    #include

    #define W 128
    #define H 98

    TVout tv;
    pollserial pserial;

    void setup() {
    tv.begin(PAL, W, H);
    tv.set_hbi_hook(pserial.begin(19200));
    initOverlay();
    tv.select_font(font4x6);
    tv.fill(0);
    }

    // Initialize ATMega registers for video overlay capability.
    // Must be called after tv.begin().
    void initOverlay() {
    TCCR1A = 0;
    // Enable timer1. ICES0 is set to 0 for falling edge detection on input capture pin.
    TCCR1B = _BV(CS10);

    // Enable input capture interrupt
    TIMSK1 |= _BV(ICIE1);

    // Enable external interrupt INT0 on pin 2 with falling edge.
    EIMSK = _BV(INT0);
    EICRA = _BV(ISC11);
    }

    // Required to reset the scan line when the vertical sync occurs
    ISR(INT0_vect) {
    display.scanLine = 0;
    }

    void loop()
    {
    if(pserial.available())
    {
    char c = pserial.read();
    pserial.print(c);
    }
    }

    #1624
    Michael
    Keymaster

    I would not initialize the serial communication at the beginning of every horizontal scan line. Instead of this:

    tv.set_hbi_hook(pserial.begin(19200));

    try this

    pserial.begin(19200);
    #1625
    Michael
    Keymaster

    I’ve always used speed of 57600. try that.

    #1626
    fanatycoland
    Member

    i have another problem now don’t receive the string

    #1627
    fanatycoland
    Member

    it work on speed 57600 but sometimes cut the string..

    #1628
    Michael
    Keymaster

    i don’t know what to tell you. I’ve used it successfully. Since I didn’t write these libraries, I can’t support them very well, ya know? I support my hardware. Try a higher speed yet.

    #1629
    fanatycoland
    Member

    I want to ask you if you can give to me a example .please

    #1630
    Michael
    Keymaster
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.