1

I'm trying to figure out how you draw to the Adafruit 1743 with a 6502 micro processor with assembly (with the vasm compiler). I've searched through the data sheets (found here: https://www.mouser.com/datasheet/2/737/adafruit_2_dot_8_color_tft_touchscreen_breakout_v2-1396576.pdf and here: https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf) but I can't seem to figure it out. Although, I do NOT have the Adafruit 1743 yet. But I will test any answers to this question as soon as I receive it. But I am thinking ahead at least.

But I'm not even 100% sure if it will work with the 6502 even though it looks like it should, because all they show is pictures of it with an Arduino but I believe they used a third party controller which suggests to me that you could use a 6502 with it (and it does say it has an 8-bit mode (found here: https://www.mouser.com/ProductDetail/Adafruit/1743?qs=%252BEew9%252B0nqrDivuzDpdISFw==&mgh=1&gcl))

Anyways if you can help please do. Thanks in advance!

P.S. if you know how the touch screen works too that would be great but it's fine if you don't.

Samm
  • 11
  • 2
  • Well, you will first need to wire it up. That involves at least adding some address decoder logic to set the `CS` and `C/D` lines depending on the cpu address lines. You will also need the `W` and `R` signals probably synthesized from the `R/-W` of the cpu and the clock. Also note the datasheet says output is at 3.3V so you will need a level shifter if the 6502 is 5V only. They also say SPI mode is preferred but that may be more complicated. – Jester Dec 18 '21 at 00:00
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 31 '21 at 14:37

2 Answers2

3

As I couldn't find any useful answers to this and needed to do the same thing.

You wire D0-D7 on the Adafruit board to one port on a VIA, you wire RD, WR, C/D and CS to the other port. RST goes to Vcc (it's got an onboard reset controller and software reset command). Vcc and GND go where you expect.

The current version at least has level shifters so it can all be at 5v.

Init the VIA to be outputs. If you are debugging this initially consider putting a set of 100ohm resistors on the data lines in case you screw up.

Commands are sent with the following sequence (idle state is CS high, RD high WR high, C/D don't care)

lower cs lower c/d put a byte on the d0-d7 lines lower wr raise wr raise c/d

for each data byte put a byte on the d0-d7 lines lower wr raise wr

then when the command is done raise cs

For read it's much the same except having sent the command byte it's

raise c/d switch the data port direction to read

then for each byte

lower rd read the data raise rd

at the end switch the direction back after rd is high, raise cs

A good test is to read a few bytes from command D3. That should give you a sequence including 93 41 for the controller ID.

If you are using some of the clone boards be VERY careful about the backlight line, preferably don't use it as some of them are mis-designed and sink large currents through it if you pull it low.

Initialization sequences for Adafruit ones can be copied from the Adafruit libraries - it's just a stream of magic command incantations and delays. For the non Adafruit ones you can grab them from Dave Prentice's MCUFriend_kbv library and those seem to work with every cheap ebay ILI9341 board.

And that's about it. To draw you use command 2A and 2B to set an X and Y range, then 2C and keep firing pixels at it (RGB565 so two writes a pixel). If you need to take a breather you can send 3C to continue writing.

Don't expect to win any awards for performance, but it's better than SPI bitbanging. No delays are needed - the VIA is way slower than the controller.

In theory you can direct connect it to a 6800 or 8080 style 8bit bus (with shifters) but at the moment I've not managed to get that to work. The theory is you wire it to D0-D7, A0 (for the C/D line), and RD/WR/CS or their equivalent if the chip is in 6800 mode plus a chip select decode.

The non display parts are more mixed.

The SD you need to bitbang with the VIA. You need 4 pins for that which you happen to have left. The resistive touch screen needs A->D convertors so isn't really usable. The capacitative one would need bit bang i2c but I dont have one to try.

The clone ones generally multiplex the resistive touch screen with some of the other pins and seem to do so fairly randomly by board maker.

Alan Cox
  • 198
  • 6
  • And to fill in the last part of the story. It works on a native bus if you are slow enough or add wait states - read from frame buffer ram in particular is very slow. – Alan Cox Apr 22 '23 at 16:48
1

One way to make this work is by using a 6522 VIA and implementing SPI in software to talk to the display (reading/writing to it bit by bit). Here's an example of a homebrew 6502 system that implements peripheral access using SPI over a VIA: https://steckschwein.de/hardware/via-65c22-as-spi-master/.

user2303197
  • 1,271
  • 7
  • 10