Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
It’s Game Time
Matt Jenkins <mdj@emdeejay.net>
OzKFest April 2015
ScramWorks
• Design has evolved to higher capacity SRAM
• 1 or 2 chips for 8MB or 16MB capacity
• 3.3V circuitry
• 100% Ra...
Serial Segue
• Communicates between computer systems
• Or between parts within a computer system
• Increasing replacing pa...
Serial Style
• Asynchronous
• Rely on accurate timing on each end point
• Synchronous
• Clock is provided on the bus
• Flo...
Serial - RS232
• Super Serial Card, Apple IIc, 6551 ACIA
• Asynchronous
• In band and out of band flow control
• XON/XOFF, ...
Serial - intercomponent
• Widely used in Arduino
• RTC, Stepper Motor, GPIO, Servo
• i2c
• SPI
• 1-wire
i2c
• Inter-Integrated Circuit
• 2-wire, synchronous, half-duplex
• 10Khz, 100Khz, 400Khz modes
• Open-drain
• Multi-maste...
i2c
• Data line - SDA
• Clock line - SCL
• Master drives clock
• All devices share data line
• Actual speed can be variabl...
i2c
(Image from Wikipedia)
Apple II - i2c ?
• Can it be done ?
• i2c allows slower speeds
• Ought to be easy!
• Where do we plug it in ?
Apple II Game Port
• 4 Annunciator outputs
• 3 Pushbutton inputs
• 4 Paddle Inputs
• 1 Utility Strobe
Apple II Game Port
Apple II Game Port
• Inputs and outputs are TTL
• But i2c is open drain
• Going to need some electronics!
Emitter Follower
Open Drain
Apple i2c - Schematic
• Two MOSFETs
• Two Resistors
• Two sets required to do both SDA and SCL
Apple i2c - SDA schematic
1243774
Apple i2c - Code
• Some simple assembly language
• Merlin 8/16 (32?)
• Macros should help
• Ampersand extensions for Apple...
Apple i2c - Code
AN0OFF EQU $C058
AN0ON EQU $C059
AN1OFF EQU $C05A
AN1ON EQU $C05B
PB0 EQU $C061
PB1 EQU $C062
PB2 EQU $C0...
Apple i2c - Code
SDAOFF MAC
BIT AN0ON
<<<
SDAON MAC
BIT AN0OFF
<<<
SCLOFF MAC
BIT AN1ON
<<<
SCLON MAC
BIT AN1OFF
<<<
Apple i2c - Code
SCLSTAT MAC
LDA PB1
<<<
SCLWAIT MAC
WAIT SCLSTAT
BMI WAIT
NOP
<<<
I2CSTART MAC
SDAOFF
NOP
NOP
NOP
NOP
SCL...
Summary
• Not working yet (sorry!)
• Questions ?
Upcoming SlideShare
Loading in …5
×

It's game time

692 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

It's game time

  1. 1. It’s Game Time Matt Jenkins <mdj@emdeejay.net> OzKFest April 2015
  2. 2. ScramWorks • Design has evolved to higher capacity SRAM • 1 or 2 chips for 8MB or 16MB capacity • 3.3V circuitry • 100% RamWorks compatibility • AE and Nishida Radio video connectors • Soon, and with brothers
  3. 3. Serial Segue • Communicates between computer systems • Or between parts within a computer system • Increasing replacing parallel communications • USB • Serial ATA • PCI-e slots are serial busses
  4. 4. Serial Style • Asynchronous • Rely on accurate timing on each end point • Synchronous • Clock is provided on the bus • Flow Control • In band • Out of band
  5. 5. Serial - RS232 • Super Serial Card, Apple IIc, 6551 ACIA • Asynchronous • In band and out of band flow control • XON/XOFF, RTS/CTS • Logic level and line level. • 115,200Kbps to many megabits
  6. 6. Serial - intercomponent • Widely used in Arduino • RTC, Stepper Motor, GPIO, Servo • i2c • SPI • 1-wire
  7. 7. i2c • Inter-Integrated Circuit • 2-wire, synchronous, half-duplex • 10Khz, 100Khz, 400Khz modes • Open-drain • Multi-master capable
  8. 8. i2c • Data line - SDA • Clock line - SCL • Master drives clock • All devices share data line • Actual speed can be variable (0-100Khz)
  9. 9. i2c (Image from Wikipedia)
  10. 10. Apple II - i2c ? • Can it be done ? • i2c allows slower speeds • Ought to be easy! • Where do we plug it in ?
  11. 11. Apple II Game Port • 4 Annunciator outputs • 3 Pushbutton inputs • 4 Paddle Inputs • 1 Utility Strobe
  12. 12. Apple II Game Port
  13. 13. Apple II Game Port • Inputs and outputs are TTL • But i2c is open drain • Going to need some electronics!
  14. 14. Emitter Follower
  15. 15. Open Drain
  16. 16. Apple i2c - Schematic • Two MOSFETs • Two Resistors • Two sets required to do both SDA and SCL
  17. 17. Apple i2c - SDA schematic 1243774
  18. 18. Apple i2c - Code • Some simple assembly language • Merlin 8/16 (32?) • Macros should help • Ampersand extensions for Applesoft
  19. 19. Apple i2c - Code AN0OFF EQU $C058 AN0ON EQU $C059 AN1OFF EQU $C05A AN1ON EQU $C05B PB0 EQU $C061 PB1 EQU $C062 PB2 EQU $C063
  20. 20. Apple i2c - Code SDAOFF MAC BIT AN0ON <<< SDAON MAC BIT AN0OFF <<< SCLOFF MAC BIT AN1ON <<< SCLON MAC BIT AN1OFF <<<
  21. 21. Apple i2c - Code SCLSTAT MAC LDA PB1 <<< SCLWAIT MAC WAIT SCLSTAT BMI WAIT NOP <<< I2CSTART MAC SDAOFF NOP NOP NOP NOP SCLOFF <<< I2CCLOCK MAC SCLON NOP NOP SCLOFF NOP <<<
  22. 22. Summary • Not working yet (sorry!) • Questions ?

×