In my endeavor to replace and upgrade my synths failing displays with more modern counterparts I decided to replace the 1×16 character LCD, EL backlight (and whining inverter) with a nice white OLED display.
I purchased the display through Comet, a european (Bulgarian to be precise) company. It is clamed the OLED display is HD44780 compatible, on which the original Sharp display is based.. and as most of the character LCD’s are. For reference, see the datasheet of the original Sharp LM16155 display, and the new Winstar OLED display. Here a sheet with additional data for the OLED controller.
I desoldered the flatcable connector from the original display and soldered it onto the OLED display. The contrast pin is unused, and the backlight pins are missing, but apart from this the new display is indeed pin compatible with the original one. But.. as you can see, only the first 8 characters are visible. After some reading and searching I learned about the various adressing modes these displays have.
It seems the original Sharp display is not addressed as a 1 line with 16 character, but as a 2 lines of 8 characters display, being the first line the first 8, and the bottom line the second eight characters. Line 1 starts at address 0h, line 2 at 40h. Below tables from the datasheets show the difference more clearly:
I was hoping the Winstar controller would be able to support this ‘older’ addressing mode, by setting a jumper.. or something.
I did find the display would accept a ‘number of lines displayed’ setting in the Function Set setup command. I made a small test-setup using an Arduino controlling the display, so I could experiment with different setup commands and addressing modes. Setting N to 0 or 1 did however not influence the addressing mode. All characters written from address 40h are not visible. No way will this OLED 1×16 display be a direct replacement for a legacy HD44780 based 1×16 LCD display, without altering the way the display is controlled.
The only way to do this is to hack hack the Juno’s firmware, which is not the road I wanted to go down. I do have some microcontroller assembly programming experience, but there was no source available of the Juno’s software, I never disassembled existing binaries like this, and also I did not own an eeprom programmer.
I did however find a binary available from a guy who performs firmware hacks on the JUNO and other synths. After fiddling around with 8051 (which is the Juno’s CPU) tools like dis51, d52 and the as31 assembler I was able to create an readable asm file, and assemble it back to a bin file which was the same as the original bin. This gave me confidence to give it a try.
I purchased a nice cheap Chinese EEPROM programmer (thanks to Dave’s excellent review on EEVblog), and a couple of EEPROM’s of ebay. The original EPROM is a 128kbit NEC D27128D. The EEPROM’s I purchased were Winbond W27E257, which are pin compatible with the NEC’s. Being EEPROM’s, they’re easy to reprogram, which I expected to be doing a lot in the process of testing changes made in the software. The Winbond’s have a capacity of 256kbit, which were the smallest I could find being pin-compatible and in DIP-28-pin package. The software then has to be uploaded in the upper 128kbit of the Winbond EEPROM, from 4000h, to be addressable for the Juno’s CPU.
I spend a lot of time finding the pieces of code where data was written to the display. Below is a subroutine which was easy to find, and also easy to alter. Setting address 0 (first character on first line) is writing 80h to the display, address 40h (first character, second line equivalent to 9th character on 1×16 display) is writing 0Ch. Cutout from the Winstar sheet:
In stead of jumping the 40h in addressing we only jump 8h.
writeLCD_16_chars_17BC: MOV A, #80h ACALL writeLCD_8chars_DPTR_17AD ACALL delay_3_R0to0_17A6 ; MOV A, #0C0h ; Go to second row of 8 characters MOV A, #88h ACALL writeLCD_8chars_DPTR_17AD ACALL delay_3_R0to0_17A6 RET
Unfortunately there are a LOT of pieces of code scattered all over the place which all write data to the display, and the jumps of 40h are not always very obvious. To make things even more complicated, there is some shifting going on: When pressing the ‘Write’ button the existing text is ‘shifted’ away and new text is written on addresses 88h and 0C8h respectively. Text will shift ‘home’ when the Write button is released, and original text will re-appear. To make this work with the new OLED addressing this shifting code had to be altered so it doesn’t shifts two lines by 8, but 1 by 16.
After a couple of nights of tinkering I’ve gotten all display output correct. I’m not going to bore you with more details, but feel free to drop me a line if you’re interested.. or wish to view my annotated assembly code. See attached to final .bin file. I can burn the EEPROM for you if you want.
In the the final step I desoldered the electronics from the PSU board used to power the EL backlight. No more whining, and the result is simply beautiful!
One remark: the output of dis51 won’t assemble straight away in as31, it requires some syntax fixup. I hacked dis51 so it does produce direct usable output, and made it include the pointer address in the labels it produces. I can share this if you want.
sorry for my late response, at popular request I’ve uploaded the binary and (annoted) assembly file:
The anoted Assembly file: http://www.visuanetics.nl/ju2-2_5-modified-b.asm
The binary, ready for programming: http://www.visuanetics.nl/ju2-2_5-modified-for-OLED-final.hex