RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Sep 25, 2018 1:56 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Dec 07, 2015 5:56 am 

Joined: Sat Nov 21, 2015 1:14 am
Posts: 9
Hi all,
I'm attempting to create a keyboard in order to be used with retroBSD. My current plan is this: I have created a 5x13 pushbutton matrix, and have connected it to a PIC32MX128FB, which I will be using for debouncing and then pushing the data to my main pic, the one with retroBSD on it. However, despite looking around, I haven't been able to figure out quite how (uart? tty?). It seems jaromir has done it here, but I'm not sure how he did it exactly. https://hackaday.io/project/643-minibsd-laptop-computer

Thanks


Top
 Profile  
 
PostPosted: Mon Dec 07, 2015 9:24 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
For example - do send the chars from your keyboard via its Uart (2 wires - tx/gnd, speed 115200, 8bits, No parity, 1 stop bit) to retorbsd's Uart.
Code:
Keyboard    Retro     PC Terminal
---------------------------------
Tx--------->Rx
            Tx------->Rx
Gnd---------Gnd-------Gnd

Tx is serial output.
Rx is serial input.
To see the responses from retrobsd you have to connect your PC_terminal_Rx to retro_uart_Tx (unless you have got your tft panel working :)).
So pushing the buttons on your pic keyboard will show chars in the PC terminal window (ie Teraterm).
The next step would be the tft panel integration :)
All signals 3.3V of course.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Dec 07, 2015 10:55 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
What is wanted is a "virtual tty" system in RetroBSD. It would render its output on a graphical device of your choosing, and accept its input from a system of your choosing. Maybe having a generic input system would be good that you can then tap into for your keyboard. Kind of like how Linux does it. Maybe I'll work on something over christmas.

Sent from my SM-T555 using Tapatalk

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Mon Dec 07, 2015 9:29 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Shaun,

Simple key button keyboard to RetroBSD. Simplest is probably to scan your keyboard and have each key closure send a serial ascii code just like old keyboards did. I have built quite a few :).

IBM PC keyboards send a code on closure and a different code on opening. This makes some additional features possible. There were several protocols in the early days. Some keyboards even had mode switches on the bottom. Most now seem to just work meaning the PC figures out the attached keyboard and "just" accomodates it :). Linux source code probably documents the whole thing totally :).

Maximite had code to decode IBM keyboards and the early versions were open source. So you could just copy their tables and software. I built a Maximite system with IBM keyboard and VGA display. It worked quite well. I notice they continue to update their code but their sources are no longer on the open web as far as I know.

You might consider a cheap PIC processor to scan your keyboard and send the codes. Having a 2nd PIC will be MUCH simpler than interfacing your keyboard directly to the PIC32 and MANY less wires and any problems will much easier to locate and correct.

I wonder who will be the first to take our new LCD code and add some keyboard code and have a dedicated PIC32 as a VT100 terminal processor with a 2nd PIC32 as the 'mini-computer'. Microprocessor chips are so cheap these days having 2 or more is not a real big deal.

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 5:05 pm 

Joined: Sat Nov 21, 2015 1:14 am
Posts: 9
Thanks for the response everyone. Wiz, I am planning on doing just as you suggested; as I said in my original thread I'm using a seperate pic to do debouncing and such, and then send it over. Pito, do you think I'll be able to just write some UART code for the keyboard pic, hook up the Uart lines, and go? Or will I have to change some configuration in the kernel of retroBSD? My new TFT came in today, about to hook it up haha. I'll be sure to show you guys what I've been working on once I get this all together.


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 6:05 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
The problem with using the UART is that normally the UART is linked to a TTY which deals with both the incoming and outgoing text for an interactive session. You will have to find some way of breaking that link and capturing just the incoming data and then routing it through to your own session in some way. That is why we really want a VT system that can create an interactive session on a TFT instead of on a serial connection. Not a two second job I'm afraid.

Sent from my SM-T555 using Tapatalk

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 6:34 pm 

Joined: Sat Nov 21, 2015 1:14 am
Posts: 9
Damn, that's unfortunate. I tried just writing some quick code to push some characters through uart on a pic32 and hooked it up to my retroBSD pic, and nothing seemed to happen. Does anyone have any idea how jaromir did it? Seems like he isn't active in these forums anymore.

EDIT: Here's a link to his project: http://jaromir.xf.cz/bsd/bsd_comp.html Contains some assembly code he wrote for a PIC16 to do keyboard work.


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 6:42 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Jaromir is using dspic33 for the LCD display and vt100 emulation and pic16 (assembler) for the keyboard. So not much use for you at this stage.
THe simplest way to start is to communicate from your keyboard's pic32 to PC - via usb dongle.
Run Teraterm, for example, and you can develop the keyboard without using retrobsd. When it works you may switch it to retrobsd..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 8:07 pm 

Joined: Sat Nov 21, 2015 1:14 am
Posts: 9
That's actually what I'm working on right now (I've got a Mac so I've been using the screen command). Just not sure how it'll work out with the retroBSD pic but we'll just I have see I guess!

EDIT: No Luck using UART after wiring up a keyboard (which I tested using keyboard to PC uart). Sending ascii characters at 115200


Top
 Profile  
 
PostPosted: Wed Dec 09, 2015 10:23 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Do not worry. That is normal. It takes ~3 days and you will see the chars.
;)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Dec 09, 2015 10:28 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
How are you reading from the uart to receive the characters?

Sent from my SM-T555 using Tapatalk

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission