Store › Forums › Video Experimenter › Bugs/Problems › Problem pollSerial
- This topic has 11 replies, 2 voices, and was last updated 12 years, 6 months ago by
Michael.
-
AuthorPosts
-
April 19, 2013 at 4:15 pm #607
fanatycoland
MemberHello ,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 !
April 19, 2013 at 6:14 pm #1620Michael
KeymasterWhat speed are you running pollserial at? I would keep it at a low speed like 9600.
April 19, 2013 at 6:39 pm #1621fanatycoland
Memberthe speed is 9600
April 19, 2013 at 6:49 pm #1622Michael
Keymastermaybe try a higher speed, then.
April 19, 2013 at 6:52 pm #1623fanatycoland
Membersome 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 98TVout 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);
}
}April 19, 2013 at 7:01 pm #1624Michael
KeymasterI 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);April 19, 2013 at 7:03 pm #1625Michael
KeymasterI’ve always used speed of 57600. try that.
April 19, 2013 at 7:13 pm #1626fanatycoland
Memberi have another problem now don’t receive the string
April 19, 2013 at 7:14 pm #1627fanatycoland
Memberit work on speed 57600 but sometimes cut the string..
April 19, 2013 at 7:16 pm #1628Michael
Keymasteri 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.
April 19, 2013 at 7:18 pm #1629fanatycoland
MemberI want to ask you if you can give to me a example .please
April 19, 2013 at 7:21 pm #1630 -
AuthorPosts
- You must be logged in to reply to this topic.