tashtari
PIC Whisperer
"I've discovered more writing on the parchment!"
Looking at the code some more, based on the timing in sending the '1' start bit, I think the external clock is 2 MHz exactly.
Also, further confusing the issue about the data direction registers, there are a pair of subprograms that ostensibly clock a byte into and out of the VIA using the same pin in both directions (pin 9, RB3, CB2 on the VIA). I had previously thought this was an output. This doesn't make sense unless the PIC's GPIO ports are open-collector - a 1 meaning let float and a 0 meaning pull to ground. It'd explain some other stuff I'm seeing in the code. Thing is, that's not how the GPIO ports on the PIC16F54 work. Maybe Apple made some kind of deal with Microchip to make a special open-collector version of the PIC16CR54, because that's not how the PIC16CR54 works, either...
This is a problem, because it means one can't shim a couple instructions in to make the PIC16F54 work like the special Apple PIC16CR54, nor is there a register substitution that can be made to do the same. At this point, what I've seen makes me think it'd be better to target imitating the chip rather than duplicating it.
Looking at the code some more, based on the timing in sending the '1' start bit, I think the external clock is 2 MHz exactly.
Also, further confusing the issue about the data direction registers, there are a pair of subprograms that ostensibly clock a byte into and out of the VIA using the same pin in both directions (pin 9, RB3, CB2 on the VIA). I had previously thought this was an output. This doesn't make sense unless the PIC's GPIO ports are open-collector - a 1 meaning let float and a 0 meaning pull to ground. It'd explain some other stuff I'm seeing in the code. Thing is, that's not how the GPIO ports on the PIC16F54 work. Maybe Apple made some kind of deal with Microchip to make a special open-collector version of the PIC16CR54, because that's not how the PIC16CR54 works, either...
This is a problem, because it means one can't shim a couple instructions in to make the PIC16F54 work like the special Apple PIC16CR54, nor is there a register substitution that can be made to do the same. At this point, what I've seen makes me think it'd be better to target imitating the chip rather than duplicating it.