[Coco] Arduino as a Mouse/Keyboard interface?

Steve Bjork 6809er at srbsoftware.com
Mon Jul 2 20:35:37 EDT 2012


One technology that could be used is Dual Port Ram.  The CoCo keyboard 
PIA ports would create 7-address lines and 8-data lines going to one of 
the ports of ram and would be read only.  The other port would be fed 
the current state of the simulated keyboard matrix from a simple 
Microcontroller.  But it's hard to find dual port memory these days.

Another way is to halt the 6809 when the column output lines changes.  
Just use compare logic to halt the 6809 and tell the microcontroler to 
update the data on the 8 bits of the row lines feeding into the other 
PIA.  To start-up the 6809 again, just store new column data in to the 
matching/halt register of your logic.  Most microcontroller have fast 
IRQ system and should be able to respond without losing more than a 
cycles during the 6809 halt state.

Steve


On 7/2/2012 11:45 AM, Phill Harvey-Smith wrote:
> On 02/07/2012 17:32, Andrew wrote:
>>> Rather than hooking the AVR's I/O lines directly to the 6821, a better
>>> IMHO way of doing it is to have a crosspoint switch in between such as
>>> the MT8816, the AVR translates the PS/2 (or USB) scancode into a
>>> row/column, and turns on or off the switch (within the crosspoint) that
>>> corisponds to the CoCo key you want to press. The output from the
>>> crosspoint matrix is connected to the CoCo keyboard port.
>>
>> IYO, why would this be better than direct control by the ATMega
>> (assuming the pins were available, and direct port addressing was used)?
>> I could see using a buffer or such in between the parts, and such a
>> switch would take care of that aspect.
>
> Because of speed, and different methods of scanning the keyboard.
>
> Basically the CoCo (ROM) scanning routine does this :
> 1. Store column to scan in PIA col
> 2. Read PIA rows
> 3. shift to next column, if all done exit
> 4. goto 1
>
> Now this means that in between the CoCo storing the coulmn to scan and 
> then reading it a few instructions later the AVR has to work out which 
> column is being scanned and output it's data on a port, now some of 
> the ATMegas can be clocked at 20MHz so *MAY* keep up with this.
>
> Also what happens when some program e.g. a game decides to drive 
> mutiple columns low to just test if a key is pressed ? This will 
> cirtainly confuse whatever code was on the AVR.
>
> The crosspoint switch because it is an array of switches, just 
> switched on and off by the AVR instead of directly pressing them will 
> work exactly as the real keyboard does.
>
> You may also be able to do this with a collection of latches or a CPLD 
> / FPGA. But I suspect that you are going to need some circuitry 
> between the AVR and the CoCo.
>
> I am willing of course to be prooved wrong :)
>
> Of course if you where going to write driver software for the CoCo 
> side then there would be no problem, however this would of course 
> break backward compatibility.
>
> Cheers.
>
> Phill.
>





More information about the Coco mailing list