Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard + mouse + hires 24-bit color graphics = zero extra I/O and memory = P2PC? — Parallax Forums

Keyboard + mouse + hires 24-bit color graphics = zero extra I/O and memory = P2PC?

Peter JakackiPeter Jakacki Posts: 10,193
edited 2020-08-14 15:10 in Propeller 2
Ok, we know that if we want to connect a USB keyboard and mouse to the P2 that it will take 4 I/O and a lot of P2 resources to implement. Then we want to drive a hires display in 24-bit color display as well but that's not possible with the limited memory, and not quite possible with HyperRAM either. The HDMI will take 8 I/O as well, so that is a total of 12 I/O so far but include another 11 I/O if you use HyperRAM to get hires and hi-color. Serial and Flash/SD use up another 6 plus I use 2 for I2C as well. So there goes port B or all the RAM.

But can you do it with less? Yes, if you use BT keyboard and mouse through the existing ESP32 on the new P2D2+P2PAL. As mentioned in another thread the display would be implemented as a serial BT display hosted on an Android tablet. I also picked up a cheap 2.4GHz wireless keyboard for $12 and an $8 mouse which I will look at interfacing to via the ESP32 as well although I might sniff out the protocol first with an nRF24L01 module.

The Android tablet would be running an app that will turn it into a serial graphic display possibly with some local icon graphics commands to draw buttons and mouse pointer etc to cut down on comms. The screen is also an input device of course. There are at least 3 ways we could talk to the display and they would be:
1 - USB to Android USB OTG host
2 - BT serial
3 - WiFi stream via the ESP32 HSPI port on the P2D2+

I've used standard USB FT/CP serial devices plugged into Android phones in the past as well as BT serial with a simple terminal app.

Obviously it won't be any good for video playback from the P2 itself but photos and mixed text and graphics GUI stuff will be great. It will take time but there's a lot of talent on this forum that we could work together and make it happen sooner.

What do you do with all the P2 memory that hasn't been gobbled up? Write your compilers and tools to run on the P2 itself. Imagine PNut native to the P2 rather than x86 etc. So the tools could compile and generate a binary that gets loaded into Flash or SD but is booted by a custom BIOS, maybe as the 1k primary Flash boot, much like a PC where we can then autorun etc.

I think there should be a new thread just about doing just this.

P2D2 pcbs are done but going through the revision and improvement stages. I will post updates on the P2D2 thread early next week.

Here's the $12 wireless keyboard I picked up. I would have grabbed the $30 BT keyboard too but the store was out of stock.
724 x 298 - 96K
«13

Comments

  • Peter, you are a true visionary !

    My dream also.. such a combo would be all I'd ever need.

    I do not have the skills to support development but maybe I could help a bit in some other way like with the docs or something ?
  • ElectrodudeElectrodude Posts: 1,657
    edited 2020-08-14 19:05
    Isn't text mode, perhaps with fancy line-drawing characters, sufficient for an IDE on the P2? That eliminates the frame buffer, letting you keep both your I/O and your RAM, and avoid being tethered to an Android device.

    If you're going to bother with putting the console on a separate device, why not just use a second P2 as a slave dedicated to running the console? You could have a fast streamer-based parallel bus between the two.
  • Cluso99Cluso99 Posts: 18,069
    FWIW a keyboard that supports the PS2 interface (most/many USB keyboards actually still support the old ps2 mode by checking for pull-ups on both IO lines. Not sure if this might work for mice too.
    Now, you can actually connect the ps2 keyboard as a 1pin serial input (see my 1-pin driver on P1).

    The tricky part is the speed as they are not very accurate so you have to work out the speed for each keyboard. It doesn’t seem to change so once calculated you can “fix” the speed in you code. Alternately, you need to sample a space character and derive the speed - I’ve done this too.

    I presume that the same may be possible with the mouse but I’ve never tried.

    Another idea I had was to replace the tiny pcb in the keyboard with a new pcb and micro - a P1 would work nicely although a little expensive - and just output serial. Unfortunately all keyboards use different sized pcb to connect to the key mat (the edge connection on the main keyboard keys which usually consist of two layers of Mylar tracks). This could also be used for interfacing to smaller laptop keypads although you then need a case which could be 3D printed.

    I realise you’re allowing for HDMI, but IMHO VGA is totally acceptable and only uses 5 pins. I’m not sure how many vga monitors support sync on green which then only needs 3 pins. Probably worth trying.

    However, even using 32 pins on port B still leaves 32 pins free for whatever and this should be more than enough for most things. And if resources are not available for this, then a high speed serial to a separate P2 for the above is still a realistic alternative. And the only software difference is the serial transport protocol so the bulk is still usable, and has the advantage of being P2 based.

    So to sum up, a P2 based solution makes the most sense to me. The P2 software can leverage and be leveraged, which IMHO is a win-win solution.
    The use of a cheap Android tablet/phone is the next best thing to total P2 self hosting, and if I understand Peter correctly, this is only for keyboard/mouse/display and not for actual hosting, so the code shouldn’t be that bad.
  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2020-08-14 22:45
    Cluso99 wrote: »
    most/many USB keyboards actually still support the old ps2 mode by checking for pull-ups on both IO lines. Not sure if this might work for mice too.
    Nope, to my knowledge most USB mice don't support PS/2 in any capacity.

    Cluso99 wrote: »
    I realise you’re allowing for HDMI, but IMHO VGA is totally acceptable and only uses 5 pins. I’m not sure how many vga monitors support sync on green which then only needs 3 pins. Probably worth trying.
    A sync seperator IC like LM1881 (not sure if that particular one supports full HD scan rates (EDIT: apparently yes)) can pull HSYNC/VSYNC out of a CSYNC or SoG signal. That'd work with any monitor.

  • Cluso99Cluso99 Posts: 18,069
    Wuerfel_21 wrote: »
    Cluso99 wrote: »
    most/many USB keyboards actually still support the old ps2 mode by checking for pull-ups on both IO lines. Not sure if this might work for mice too.
    Nope, to my knowledge most USB mice don't support PS/2 in any capacity.

    Cluso99 wrote: »
    I realise you’re allowing for HDMI, but IMHO VGA is totally acceptable and only uses 5 pins. I’m not sure how many vga monitors support sync on green which then only needs 3 pins. Probably worth trying.
    A sync seperator IC like LM1881 (not sure if that particular one supports full HD scan rates (EDIT: apparently yes)) can pull HSYNC/VSYNC out of a CSYNC or SoG signal. That'd work with any monitor.
    I don't think the LM1881 would do the job. It is for composite NTSC/PAL. It only extracts HS and not VS. And it adds parts to the BOM.
    There are probably easy ways to extract the VS and HS if necessary.
  • Some Chromebooks can run Android apps.


    I've looked at the signals of HD-TVI cameras. They send up to 4K video over one coaxial cable. Monochrome seems easy. I don't have any info right now about how the color is encoded because that is way above the passband of the P2 adc. Might need 100MSPS to decode the color. But a DVR or standalone converter to get HDMI or VGA costs $50-$70.

    The P2 should be able to generate an ATSC signal. One pin. But it might take several cogs.


    HDMI could use only 4 pins if we added an external LVDS converter. Of course, those 4 pins would all be odd (or even) numbered.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-15 02:48
    I know some USB keyboards do support PS/2 but not many, and which ones? In the early days the PS/2 data was clocked because the 8048s they used were running from reasonators and the timing could be off. However I have found that any modern keyboard from the last 2 decades has a very precise timing so it is easy to set a smartpin in one-pin serial rx mode for PS/2.

    So of course we could use USB keyboards that support PS/2, but which ones? Of course we could use USB keyboards and mice, but at a cost. Of course we could drive HDMI or VGA monitors, but at a cost. The main cost is in terms of hub RAM and cogs, and a little bit of I/O.
    Having the ESP32 as the go-between is very useful, because even though it is its own master, it is always a slave to the P2 and a useful and versatile peripheral.

    Get rid of all the connectors and wires, and bring on the wireless keyboards, and mice, and "BT display terminal". How much do we pay for a bare 7" HDMI touch screen? We can have the whole package "touch screen" including BT, WiFi, battery, and local GPU for the same price. It's also possible to have the keyboard and mouse connect to the tablet instead.

    The USB-C connector on the P2PAL opens up a host of easy to connect I/O. Although primarily intended as a common connector for HDMI and VGA, it also has I/O for the USB as well. So that's 10 I/O and +5V that could be fed to an I/O module.
  • SuracSurac Posts: 176
    edited 2020-08-15 09:40
    And what will people get that don’t have a android tablet? I will never willingly invest in
    Google or there android system

    All you write here can be done with a simple serial connection. I see no benefit in adding BT or a Tablet. use your PC and connect the p2 via usb/serial and you also have ram and io free.
    Use a terminal emulation to get some gui
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-15 11:43
    @surac - I couldn't care even if it were Microsoft (for example). The tablets are around the same price as any touch screen display kit but unlike a kit, they have their own GPU and connectivity etc. So are you saying that tethering to a clunky PC with a clunky OS via serial is the same thing? Not even close.

    The keyboard is connected to the ESP bone,
    the mouse is connected to the ESP bone,
    the "display" is connected to the ESP bone,
    and the ESP bone is connected to the P2 head bone,
    so here the word is stand-alone.

    I've noticed that even on the forum that people are getting antsy and irritable, even over wording. Is it just covid cabin fever? Is it who is going to be "not my president" or just the whole uncertainty of life in this 21st year of the 21st century? I enjoy being on the forums because we can stretch out and relax and talk shop and just help each other, not in someone else's way, but in our own way.
  • Keep it super simple. I have a few applications that just need a good solid VGA interface, not even hi res. Something like 640x480 would be fine - with tiles at 40x15, 50x24 and 80x40. Choice of fonts, I like the original 32x16 P1 font. We now have full scale 24-bit color with the P2. Easy to understand and use VGA interface, great for the beginner and pro, perfect for a lot of people.

    Later, if you want to add a keyboard and mouse, fine. Maybe a super simple bit-mapped graphic, fine - but not necessary. My 2-cents.
  • I have tried to make peace with tablets, I just can't get there for much more than game playing or light web browsing.

    Even with a laptop I plug in a full-sized keyboard and mouse if using for more than a few minutes.

    I'd like to see something along the lines of what Peter is proposing, but with a Raspberry Pi instead of a tablet.

    C.W.

  • The RPi is another board, not the display. To add the display kit costs as much as a tablet.
    Do you want you HDMI/VGA? I do it now and nothing is stopping you except the memory limitations, and oh, the memory itself.

    If you have a P2D2+ sitting there and you want to add a small "monitor" the dead easy way, then do it with BT and a tablet. It's a no-brainer and that's what I did years ago with P1.

    Guys, you are missing the point. You can have this, and you can have that, but you can also have that as well. Nobody but a complainer ever complains that there is one extra item on the menu, or a few extra even. It's all good.
  • @Peter
    you presented your Idea here. I gave you my thoughts and you don't like it. Fine you don't have to like ti like it :)
    I understand you like to build a "Standalone" P2 system there you do not need a PC.
    I on the other side like to integrate a P2 in an embedded System with no further components.

    You gave me a Scenario with no explanation what it should be for.
    I gave you my Scenario with no explanation what it should be for.

    If you like to call me someone with covid cabin fever? fine, but do not rant that you get answers on the forum you don't like.
  • Cluso99Cluso99 Posts: 18,069
    Furthering the idea of a self-hosting P2, today I dug out a pair of old laptops and stripped them down. I have a 15.6” 1366x768 LCD and a 15.4” 1280x800 LCD. The former is from an HP/Compaq and has a nice small bezel, so I’ve ordered a VGA/HDMI controller board kit from flea bay. The nicer keyboard is also from the HP, so I’m going to connect it to my P2. There is a nice trackpad on the Thinkpad laptop so I’m going to connect it also. And the keyboard from the Thinkpad has a pointpad (the little red button in the middle of the keyboard) so I am going to give it a try too. From what I’ve read, this should have an I2C interface.

    So my P2 will have a nice 15” VGA, small keyboard including numeric section, a trackpad, a finger pointpad, and the microSD. This will be my standalone P2 system, and will connect to my P2 development board via high speed serial.

    The standalone P2 will be equivalent to Peters ESP32 + android tablet. We should be able to use the same serial interface and software on our development P2 board.

    What do you think Peter?

    Maybe I better also order a second VGA/HDMI controller kit for my second LCD as I might want a VGA display for my P2 development board too as it will take a month or more to get it.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-15 14:32
    @surac - what's going on here? These are all options on top of options I'm talking about. I get that you don't like Google or Android, but that is not what this is about, just as I said "I couldn't care even if it were Microsoft". Get it? Nothing in what I said indicated "I don't like" although you were quite open about what you don't like. Ok, leave it at that.

    This is a technical forum and we look for constructive comments pertaining to that thread. There are plenty of threads to choose from. Why did you choose this one?

    The other comment was separated from the main body by a "we interrupt this program with a jingle" and then a general comment especially in regards to some other threads I have been seeing but don't particularly want to start a whole thread about. So it's not you, it's general. Simple.

    Btw, I'm not worried about a standalone PC myself, but the subject pops up in the forums. I am designing this hardware for standalone controllers which means I can develop on it, and then I can embed it, yet still develop on it without having to have a permanent display or keyboard etc.
  • @surac - what's going on here? .... I am designing this hardware for standalone controllers which means I can develop on it, and then I can embed it, yet still develop on it without having to have a permanent display or keyboard etc.

    That. Straight to the point. I like that. A lot.
  • Peter,
    Using BT keyboard/mouse & an Android touch screen tablet is a great idea. I've been using a couple of android BT apps to control a P1 activityBot with 2 way communication w/o all the angst I've read about trying to use wifi chips.

    I'd like to see what you come up with.

    Tom


  • @twm47099 I second your comment. Peter has a great idea and very practical for an on site job.
  • SuracSurac Posts: 176
    edited 2020-08-15 20:18

    Deleted
  • ErNaErNa Posts: 1,752
    It Is extremely simple to be miss understood. My vision is the controler to be the dev system. For purposes I need a HMI and I‘m perfectly happy with what I can have. I don‘t care about what I use if only I can affort it. So all should calm down
  • It seams my English is not good enough to understand everything written here. Sry if my comment made anybody unhappy.
    The sentence „I couldend care less if it was Microsoft“ I can not comprehend.
    Sry my first language is not english
  • Surac wrote: »
    It seams my English is not good enough to understand everything written here. Sry if my comment made anybody unhappy.
    The sentence „I couldend care less if it was Microsoft“ I can not comprehend.
    Sry my first language is not english

    Since we have great forum members from around the world, and english is not their first language, this happens a lot. I'm sure your apology should be accepted by the ones offended.
  • @surac - I'm sorry if I unintentionally offended you and I was taken aback myself when you appeared offended.

    I wasn't the least bit offended myself and I was just trying to understand what's was going on here and why, and why touting an option becomes a "I hate Google" thing, especially since you started your post with that opening sentence and hadn't said anything else previously. Personally, I don't care who makes it and I mentioned Microsoft as an example of perhaps my least preference, yet I must say they make great hardware. So it's not the brand, it's whether it is well designed and good value and does the job. Silicon is silicon, no matter where it comes from. I'd use iPads if they were the same price as a 7" display kit but Apple would never do that, even though they could. btw, I used to use Apple Macs even before they were a Mac. Remember the Lisa?

    In general:
    I suppose if this was more a forum about being warm & fuzzy then we would hold back our thoughts and words, and end up cooing like pigeons instead. But we are not bird-brains, we have intelligence and we can communicate. But what we do want to hold back are not our thoughts or even our feelings to an extent, but our unchecked emotions.
  • Cluso99Cluso99 Posts: 18,069
    Oh the Lisa. Yes, we had a pre-production Lisa direct from Apple. Did my first schematics on a Lisa using Apple's Draw package that they then put onto the 128K Mac.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-16 03:01
    Cluso99 wrote: »
    Oh the Lisa. Yes, we had a pre-production Lisa direct from Apple. Did my first schematics on a Lisa using Apple's Draw package that they then put onto the 128K Mac.

    Yes, the Lisa became the Mac XL which was the version I ended up using myself with internal 10MB HDD along with a network of Fat Macs although I had used the early Lisa as well. I even had the first LaserWriter as well. Draw became MacDraw and I used that for many many things including schematics and pcb artwork. I can still read the old files using LibreOffice. Here's a screenshot of an old schematic I did with MacDraw.
    1507 x 935 - 189K
  • Do you have any specific protocol in mind?
    You mentioned mouse and keyboard input via eps and graphic output via tablet. I run a quick search for remote GUI protocols and was disappointed to find only very few articles discussing such a thing. Most only discuss vt100 and above or something like vnc. As vnc is only some intelligent screen mirroring and vt100 and above can run on simple serial connection I found nothing in between.

    I also did a quick search on how to connect bt mouse to esp and was very disappointed to not find any result

    You have experience in connection bt hardware to esp?
  • Cluso99Cluso99 Posts: 18,069
    I think the objective is to use a very simple set of serial text commands to control the screen. Part of the screen might be text and another graphical.
    Specifically, we don’t want high level transport layers as this only slows the data throughput.
  • MJBMJB Posts: 1,235
    edited 2020-08-16 16:21
    Surac wrote: »
    Do you have any specific protocol in mind?.
    Hmm ... what about using a browser for the GUI?

    Or s.th. like this..


    https://codelabs.developers.google.com/codelabs/web-serial/#0
  • I very much appreciate the „simple protocol“ approach. So it will be possible to write client Programms for different OS and devices
  • ErNaErNa Posts: 1,752
    Aribas terminal program PropTerm is an example you might look at...
Sign In or Register to comment.