[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple II Pi
On Thursday, 30 May 2013 22:20:38 UTC-7, mdj wrote:
> On Saturday, 25 May 2013 18:23:56 UTC+10, Michael J. Mahon wrote:
>
>
>
> > I'm still amazed that the RPi chip (apparently) is so unlike a
>
> >
>
> > general-purpose microcontroller that it doesn't have a single-address 8-bit
>
> >
>
> > port. ;-( I suppose that's what happens when you re-purpose a phone
>
> >
>
> > processor!
>
>
>
> The Broadcom part has 57 GPIO lines, all of which can overloaded to perform a variety of other functions (SPI, I2C, and the UART Dave is using).
>
>
>
> The chip registers are all understandably 32-bit, with the first 32 GPIO's mapped to one register set, and the remainder to another. Read and write are separate registers, and write is separated again into set and clear registers. That's the main annoying part, as that seems completely superfluous to me ?
>
>
>
> The rest of the 'problem' is that only 19 of the 57 lines are broken out on the RPi, and the ones chosen make it impossible (even if you configure them all as GPIO) to get 8 consecutive bits in the register, let alone have them fall on a byte boundary :-(
>
>
>
> I suppose the designers figured the majority of users will be bit-banging rather than byte-banging. It's relatively straightforward in C to remap a byte-sized quanta appropriately if you wanted to work around it.
>
>
>
> I expect though that the majority simply use the virtual-filesystem interface that can be effortlessly exploited in <insert-your-favourite-scripting-language>
>
>
>
> Matt
I think another aspect to the GPIO configuration lies in the fact that most embeddable components today are intelligent, so implementing a serial bus to connect the pieces is cost effective, on a pin by pin basis. The days of parallel busses are apparently over. And I have to say, implementing a protocol over the serial port is pretty easy and fast - on both sides of the Apple II/RPi equation. Linux has a huge library of support routines for serial communication built-in. The 6511 is trivial to program from the 6502, and certainly fast enough for a 1MHz CPU when transferring at 115.2 K baud. As a speed test, I wrote a simple program (dskread.c on github) to image a ProDOS floppy and save it to a file, ala ADT. I can read and transfer the data from floppy disk, send it over the serial port (and out a socket) in just over 70 seconds. I actually had to add a small delay between writing bytes out the serial port because it was losing sync, especially when sending lots of zeros. I'm not sure I would do a whole lot better with a bi-directional parallel port, not to mention the additional programming required on the Linux side.
Since most junior hackers on the RPi just want to read pushbuttons and light up LEDs, I guess I can't fault them too much for the choice of GPIO pins exposed. Anything more sophisticated will probably have an SPI, I2C, or serial interface (RS232 or USB). Again, all the more reason to expose Apple II bus access to the internetz.
Dave...