
arduino-tvout - issue #38
Problem when combining TVout library and PS2Keyboard library
What steps will reproduce the problem? 1. set up TVout, this step works, I am able to run the examples, and they work fine 2. Set up PS2keyboard library, this works, I ran teh example and it works fine. 3. Mix TVout and PS2Keyboard, when I did this, I got problems. I went ahead and combined TVout and PS2Keyboard libraries, but they seem to clash with each other, they work, but weird things happen on the TV there is a glitch whenever I press a key, and on the keyboard there is sometimes wrong keystrokes detected... they both work well indivisually here is my combined code http://pastebin.com/caVhZQcT
What is the expected output? What do you see instead? each key I type on the keyboard should just appear on the screen, but instead sometimes wrong characters appear. and also there is a glitch on the TV everytime I press a key. also, since I am logging everything to the serial port, I can see that the PS2Keyboard library is failing to recognize the characters when mixed with TVout.
What version of the product are you using? On what operating system?
I am using TVoutBeta1 uploaded to arduino uno from a windows computer
Please provide any additional information below.
I went ahead and combined TVout and PS2Keyboard libraries, but they seem to clash with each other, they work, but weird things happen on the TV there is a glitch whenever I press a key, and on the keyboard there is sometimes wrong keystrokes detected... they both work well indivisually here is my combined code http://pastebin.com/caVhZQcT
Comment #1
Posted on Sep 20, 2011 by Quick BearI tried stopping timers when a key is pressed, and enabling them after it was released. but still the input is currupted, I wouldnt really care much if there is a minor glitch in video temprarily, but I want to be able to get information from the keyboard. here is the code I tried in the PS2Keyboard library:
void ps2interrupt(void) { //stop interrupts cli();
static uint8_t bitcount=0;
static uint8_t incoming=0;
static uint32_t prev_ms=0;
uint32_t now_ms;
uint8_t n, val;
val = digitalRead(PollPS2_DataPin);
now_ms = millis();
if (now_ms - prev_ms > 250) {
bitcount = 0;
incoming = 0;
}
prev_ms = now_ms;
n = bitcount - 1;
if (n <= 7) {
incoming |= (val << n);
}
bitcount++;
if (bitcount == 11) {
uint8_t i = head + 1;
if (i >= BUFFER_SIZE) i = 0;
if (i != tail) {
buffer[i] = incoming;
head = i;
}
bitcount = 0;
incoming = 0;
}
//start interrupts
sei();
}
Comment #2
Posted on Dec 9, 2011 by Grumpy KangarooHello,
I am using both the libraries and my sketch seams to work correctly.
The only issue I found is the glitch when pressing a key. I've also observed than pressing continuously a key, the glitching phenomenon disappears.
I don't know if it's your case, but few days ago in one of mine sketches, the PS2 Keyboard library didn't recognize correctly a key due to the too high memory allocation (using a matrix)... I hope this could be helpful...
Now I will try to solve the glitching issue...
Comment #3
Posted on Dec 11, 2011 by Quick BearI have already found a fix to the problem. It was to use pollserial to get data from the keyboard. It works perfectly. I can send you the libraries and sketch if you want
Comment #4
Posted on Dec 11, 2011 by Grumpy KangarooOk! If you send me libraries and sketch I will appreciate!
Comment #5
Posted on Dec 12, 2011 by Quick BearOk, here is the library on the attached files
alos, I thought you might be interested in the BASIC interpreter for arduino I made https://github.com/amigojapan/Interactive-Arduino-Basic-Interpreter I will eventually figure out a way to do something to get enbough ram to run both the BASIC intepreter AND all TV out at the same time to make a retro computer, I think I may store the programs in progmem
also you might want to add as an example of TV out my video of this True Serial Terminal I made that actually connects to a linux computer and can control it thru a serial port. it is the latest video of my channel http://youtube.com/amigojapan
Comment #7
Posted on Dec 12, 2011 by Grumpy KangarooThank you! I am just trying your Basic Interpreter!
I'm sorry but I can't see your attachment... :(
Comment #8
Posted on Dec 13, 2011 by Quick BearOk, later when I get time I will upload it to github and send you the link or something
Comment #9
Posted on Dec 13, 2011 by Quick BearOK, try downloading it from here please http://www.mediafire.com/?ru7562sifbl204q
Comment #10
Posted on Dec 13, 2011 by Grumpy KangarooReceived!
I will try it later and let you know!
Thank you!
Comment #11
Posted on Dec 15, 2011 by Grumpy KangarooEverything working!
Thank you again!
Comment #12
Posted on Dec 16, 2011 by Quick BearGreat!
Comment #13
Posted on Apr 30, 2012 by Quick BearHi, I have another question. The ore Beta 1.0 version of TV out seemed to have a pause() function which "returns full CPU power". Is there an equivalent in the new versions?
On 2011/12/15, at 21:41, arduino-tvout@googlecode.com wrote:
Comment #14
Posted on Dec 31, 2012 by Happy Beardoes anyone have the attachment since the op was kind enough to place it on a crap server which no longer has the file?
Thanks
Comment #15
Posted on Dec 31, 2012 by Quick BearI have it on my home computer but I won't have access to it for a week or so
Comment #16
Posted on Jan 2, 2013 by Happy BearThats fine if you can repost it when you get back
Thanks
Comment #17
Posted on Jan 10, 2013 by Quick BearOK, I have heard some people on the mailing list asking about the library to use PS2keyboard together with TVout, here is a link to it https://github.com/amigojapan/Arduino_TVout_with_ps2Keyboard/blob/master/ps2uartKeyboard.zip?raw=true
Comment #18
Posted on Jan 13, 2013 by Happy BearThank you very much!
Comment #19
Posted on Jan 13, 2013 by Quick BearNo problem :)
Status: New
Labels:
Type-Defect
Priority-Medium