Re: Wiring SRAM to W65C265SQXB
Posted: Mon Jun 11, 2018 3:06 am
After destinating this gray and rainy sunday afternoon for digging into the protocols with a logic analyzer tool, the reason the display didn't work became obvious. It was a silly bug in a hex to binary conversion routine. With this fixed, the display started to work like a charm.
As mentioned in one of the previous posts, the QBX talks to the ATTiny85 via the UART0 by sending I2C ASCII/HEX command sequences. This implementation is kept very generic, and the code running on the QBX 'has to know' the bytes to write and to read.
To give an example, let's write a capital 'A' to the top left corner of the screen. This can be done by letting the QBX send two I2C write commands via UART0 to the ATTiny85 I2C Bus Master:
The ASCII/HEX format had been chosen for ease of debugging and testing. I wrote a monitor extension routine, which lets me input sequences like these, in order to communicate with the I2C devices on the bus.
Breakdown of the first command sequence:
The SSD1306 does not have a built-in character ROM, so one has to transmit 8 bytes of bitmap data in order to display a character on screen. The second sequence does basically that where the first sets the current write (cursor) position. Further details in the data sheet.
For non time critical stuff this approach works quite satisfactory, since one can plug additional I2C modules on the bus and talk to them right through the monitor.
For the display, I converted the character map data from a monochrome bitmap font I found on gitHub (https://github.com/dhepper/font8x8/blob ... x8_basic.h) and swapping the bits into the column oriented format required for the SSD1306. After writing still some crude display routines and a monitor extension for char based text input and then printing it on the display.
All that stuff is growing really fast, summing up already 6k (code and data) in memory.
Here is what the result looks like: Happy breadboarding
As mentioned in one of the previous posts, the QBX talks to the ATTiny85 via the UART0 by sending I2C ASCII/HEX command sequences. This implementation is kept very generic, and the code running on the QBX 'has to know' the bytes to write and to read.
To give an example, let's write a capital 'A' to the top left corner of the screen. This can be done by letting the QBX send two I2C write commands via UART0 to the ATTiny85 I2C Bus Master:
Code: Select all
I2C3C0400000010B0
I2C3C090040007C7E13137E7C00
Breakdown of the first command sequence:
Code: Select all
I2C3C0400000010B0
I2C command prefix
3C I2C device address
04 number of bytes to write
00 number of bytes to read (from the device after write is complete)
00 data byte 1
00 data byte 2
10 data byte 3
B0 data byte 4
For non time critical stuff this approach works quite satisfactory, since one can plug additional I2C modules on the bus and talk to them right through the monitor.
For the display, I converted the character map data from a monochrome bitmap font I found on gitHub (https://github.com/dhepper/font8x8/blob ... x8_basic.h) and swapping the bits into the column oriented format required for the SSD1306. After writing still some crude display routines and a monitor extension for char based text input and then printing it on the display.
All that stuff is growing really fast, summing up already 6k (code and data) in memory.
Here is what the result looks like: Happy breadboarding