--- title: "TS2068 Joystick Operation" type: "article" slug: "ts2068-joystick-operation" url: "http://localhost/article/ts2068-joystick-operation/" markdown_url: "http://localhost/article/ts2068-joystick-operation.md" published_at: "2022-10-07T12:26:34+00:00" modified_at: "2026-08-07T08:20:23+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "The two joysticks are controlled via Register 14 (I/O Port A) of the Programmable Sound Generator Chip (see Sections 2.1.6 and 2.1.7). Address and respectively. data are passed via Ports 0F5H and 0F6H The joysticks are read by first addressing Register 14 in the PSG by writing a 14 (OEH) to Port 0F5H. data is…" category: - name: "LISTing Newsletter" slug: "listing-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/listing-newsletter/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Reference" slug: "reference" taxonomy: "post_tag" url: "http://localhost/tag/reference/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" publication_r: id: 38992 title: "LISTing Newsletter" type: "periodical" url: "http://localhost/periodical/listing-newsletter/" issues_articles: - id: 40223 title: "LISTing Newsletter September 1992" type: "issue" url: "http://localhost/issue/listing-newsletter-september-1992/" pages: "8-9" pubdate: "September 1992" archive_link: false gallery: - url: "http://localhost/wp-content/uploads/2022/10/read-joystick.png" - url: "http://localhost/wp-content/uploads/2022/10/joystick-schematic.png" --- # TS2068 Joystick Operation The two joysticks are controlled via Register 14 (I/O Port A) of the Programmable Sound Generator Chip (see Sections 2.1.6 and 2.1.7). Address and respectively. data are passed via Ports 0F5H and 0F6H The joysticks are read by first addressing Register 14 in the PSG by writing a 14 (OEH) to Port 0F5H. data is then read by executing an The IN from Port OF6H, having the port address in 280 Register C and the joystick (player) number in Register B (number = 1 or 2). Note that PSG Register 7, Bit 6 is assumed to be zero, enabling I/O Port A for input. If you ever use I/O Port A for I/0 Port A for output (R7, B6=1), you will want to clear Bit 6 prior to any input operation. ``` Sample routine: GETJOY LD A,OEh Load A=14 OUT A,(0F5h) Address the joystick port LD B,playerno LD C,0F6h Data port address C IN A,(C) Joystick data to A CPL Complement to high active AND 8Fh Get significant bits ``` The data read is LOW ACTIVE, i.e. all bits = 1 (byte=FFH) when the stick is at center and the button is not depressed. Figure 4.3-1 shows the interpretation of the data byte. #### Note This is reprinted from the [Technical Manual](http://localhost/book/timex-2068-technical-manual/).