Keyboard driver
Rsadeika
Posts: 3,837
I looked through the Demo folder and I did not see any C driver for the keyboard, are there any? Of course this would be used with my C3 board.
Ray
Ray
Comments
Ray
The default output is the serial port.
I'll include some VGA code in another post later.
Thanks,
--Steve
Ray
Do any of your keyboards work with the Parallax KeyboardDemo.spin program on the C3?
The .spin file I'm using is the same Keyboard.spin used in that demo, so in some ways it simplifies things.
However, there is a small defect in Keyboard.spin that can cause some keyboards to not work.
Ray
Please note that typing Enter will not affect the terminal.
Also, please change the main function to look like this:
Added fflush(stdout); after putchar(...).
Ray
I just loaded Steve's example straight from the .zip built it in SimpleIDE 0.3.0 and ran it on my C3 board. I have a TRUE PS/2 keyboard attached. It worked fine.
Are you using a PS/2 keyboard or are you using a USB keyboard through a USB to PS/2 adapter? Some USB keyboards work this way, others don't. The one I happened to try didn't work. As stated above, through, it does work with a true PS/2 keyboard.
Hope this helps!
Back to carpet cleaning for me!!
Ray, I really want to get you going. Don't give up.
The keyboard pins for the C3 and Demoboard are the same.
Yes, I've tested the program with a PS/2 compatible keyboard.
Actually, I've identified some issues:
I mentioned using LMM mode, but the original demo uses COG mode. Please forgive me this.
With COG mode, you can't use fflush or Simple Printf.
Maybe we should go back to the original demo that @mindrobots used for now.
There are some inconsistencies between COG and LMM modes.
Checking the Simple Printf option and using fflush will actually cause a build error in COG mode.
LMM can use Simple Printf or the full standard C library implementation.
LMM mode must follow C's printf rules because of buffering.
It is possible to turn off buffering however.
I'm thinking that I should automatically disqualify Simple Printf in COG mode.
If we're voting, and since this is a simple IDE, I'd vote to protect the user by blocking invalid combinations (Simple Printf in COG mode). If could ever be used, we aren't smart enough to use it at this point and allowing the combination just causes grief.
I've ended up with some play time finally, this weekend, so I'm going to find my Demo board and see what I can see......
Rick,
This message will self destruct in 5 minutes. Not so impossible though ....
Assuming you are considering connecting VGA as a stdout device for use with printf, etc.... There is a TV demo that shows how to connect TV as a stdout device in the PropGCC Demos package. It would be an example to follow for a VGA stdout device. Make the TV demo work first, then a comparable VGA could be like eating cake.
The Spin-like alternative would probably be easy. You could look at the demo package demos/Term and connect something like that. As is, Term supports one of 3 interfaces: Serial, TV, or VGA. If you just wanted a VGA device, you could simplify Term to do that.
Good luck Mr Phelps.
--Steve
I was just planning on getting the VGA text demo in the demo package working and bundled up with the keyboard demo so you could type on the keyboard and see it on the VGA. The VGA stdout sounds interesting and useful...
BUT FIRST MR. PHELPS' BOSS....you weren't kidding about self destructing.
I've been trying to build a SIDE project using the propgcc VGA demo files.....and it's been driving me crazier.
1) I start up SIDE
2) open file - navigate to the VGA demo folder and select the vgatest.c file
3) it opens in the IDE and the .side file is created
4) right click on vgatest.c and select add file (you can open up the other .c file and the .h file at this point if you want but it always comes down to opening the .spin file where failure lurks)
5) from the dialog box select the VGA.spin file
6) it opens BUT the file is VGA.spin is collapsed from 49K of wonderful SPIN code to 1K of garbage which shows this in the IDE editor: ÿþ'
7) I exit out of SIDE and open the .SPIN in notepad++ and it is truly destroyed.
8) delete the vgatest.side, recopy a good VGA.spin and repeat the process (same results)
9) upgrade to 0.3.3 same results
10) repeat several times with similar results (checked the definition of 'insanity' and decided to stop)
The VGA.spin is replaced with the VGA.spin from the propeller tool example library each time.
I just tried the same thing with the TV_text folder and created a valid project.
I'm curious if this is just me or if there is something special about VGA.SPIN.....
it's OK to say it's just me!
Sorry, it's me. If you want to open the .spin file in the IDE, it has to be converted from UTF-16 to UTF-8.
For the time being I recommend not opening the file in SimpleIDE.
Guess I should not allow them to be opened until I can fully support editing UTF-16 Spin files.
Sorry about that.
--Steve
I guess I am down to my Demoboard, I do not trust my clunker C3 board, and I do not trust my clunker GG board(s). Working with those boards is making me look like a fool, I guess I am tired of that scenario.
Working with the Demoboard, I will not be able to test any of the XMM, or XMMC examples, which was the purpose of checking out C, in the first place. And since it does not have a uSD, that also goes to the wayside. I guess somebody else will have to experiment.
The reason I am posting all this detail, what do you think some new user is going to think about the experience of PropGCC, and associated boards, if they go through something like I just did? It is all in the small detail(s)!
Now, what else can I do with the Demoboard?
Ray
I'm sorry to hear of your bad experience. I have a C3, Demoboard, Quickstart(x4), Protoboard(multiple), GG board(x2), PPDB, S2(x2) and probably a few I'm forgetting about.....and a PropBOE on the way. I haven't had a problem with any board that I would trace back to hardware or quality problems. My experience is that production quality is something Parallax is very concerned about and responsive to. I would say the same for Nick and company at GadgetGangster.
An SD card can be added to the Demo board. If nothing else, you can solder pins to an SD card contacts and plug it into the breadboard area. It does have a microphone, and the obvious KBD, Mouse, Video, VGA. It also has an amplifier for headphones. It can certainly drive servo, sense sensors, run motors and talk to peripherals in various ways. If I'm not mistaken, there is a lot of library work and product demo code to be written in propgcc.
A number of the OBEX objects, were written with the Demoboard in mind. You may also be able to just do a google search on the Parallax site with "Demo board " and find some things people are doing with it in SPIN and PASM.
Maybe you should contact them about your C3? http://support.parallax.com/
Please let me know how this turns out.