TK. Posted October 28, 2013 Report Posted October 28, 2013 Now it loads, with some special character bugs According to the datasheet of your OLED, the ROMA character set will print out an ö instead of | It seems that ROMC is better suitable. The C code shows how to change it: Write_Command(0x72); //Function Selection B. Select the character no. of character generator Select character ROM Write_Data(0x01); //CGRAOM 248 COGRAM 8 Select ROM A I guess that you've to Write_Data(0x09) instead (see http://www.buy-display.com/download/ic/US2066.pdf, page 29) and reboot every 30 seconds A reboot indicates that the USER_LCD_WaitUnbusy takes too much time. In other words: sometimes extremely much time (> 100 mS) - not desired anyhow. This could be caused by a protocol incompatibility with your display. On the other hand: it seems that this LCD is so fast, that maybe the BUSY flag doesn't need to be polled at all! :smile: Could you please check what happens if USER_LCD_WaitUnbusy just returns immediately without polling the status flags? Best Regards, Thorsten. Quote
Schrabikus Posted October 29, 2013 Report Posted October 29, 2013 Thanks for reply, Thorsten. Yesterday I found that i missed CAN interface diode. Soldered it and cyclic reboots are gone. Nex time I should better read paragraph [3] of your MBSID troubleshooting doc :blush: . "|" character started started look normal when i'm change movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A rcall USER_LCD_Data with this. movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A movwf USER_LCD_LAT_D rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr Looks like USER_LCD_Data function not working correctly with this OLED. Sending 0x09 instead to select ROMC makes no sense. Characters still ok. T.K., the question is how should look the 4-bit equivalent of this? movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A movwf USER_LCD_LAT_D rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr swapf USER_LCD_LAT_D, F movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr Quote
Schrabikus Posted October 29, 2013 Report Posted October 29, 2013 (edited) Thanks for reply, Thorsten. Yesterday I found that i missed CAN interface diode. Soldered it and cyclic reboots are gone. Nex time I should better read paragraph [3] of your MBSID troubleshooting doc :blush: . "|" character started started look normal when i'm change movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A rcall USER_LCD_Data with this. movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A movwf USER_LCD_LAT_D rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr Looks like USER_LCD_Data function not working correctly with this OLED. Sending 0x09 instead to select ROMC makes no sense. Characters still ok. T.K., the question is how should look the 4-bit equivalent of this? movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A movwf USER_LCD_LAT_D rcall USER_LCD_Strobe_Set ; rcall USER_LCD_Strobe_Clr ; transfer upper 4 bit swapf USER_LCD_LAT_D, F ; movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set ; rcall USER_LCD_Strobe_Clr ; transfer lower 4 bit movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr Is that correct or I have to duplicate USER_LCD_LAT_D, F two times more? I have some suspicions about 4-bit init fail. app_lcd.inc Edited October 29, 2013 by Schrabikus Quote
TK. Posted October 29, 2013 Report Posted October 29, 2013 Is that correct or I have to duplicate USER_LCD_LAT_D, F two times more? Actually you would have to remove one strobe, because currently you transfer 3 nibbles instead of 2 And you transfer three times a 0 (-> would result into 0x000), because in 4bit mode only the data at the D7, D6, D4 and D4 pin will be taken over by the LCD. The 4 bit protocol is: first strobe for the MSBs (data bits 7..4 directly visible at D[7:4]), second strobe for the LSBs (data bits 3..0 copied to D[7:4], e.g. via "swapf LATD, F") You can see the difference in the original implementation: http://svnmios.midibox.org/filedetails.php?repname=svn.mios&path=%2Ftrunk%2Fmios%2Fmios_clcd.inc General hint: if you do such experiments (with the danger that the LCD comes into an invalid mode), it makes sense to re-power the core after the code upload to ensure that it starts under "known conditions" (power-on reset). Looks like USER_LCD_Data function not working correctly with this OLED. In 4bit or 8bit mode? Possible reason: USER_LCD_Data is only made for 8bit mode Anyhow, currently I'm a bit confused about your posting. :-/ - are you planning to use the LCD in 4bit mode in future - and if yes: why? You've already all connections for 8bit mode - is the LCD working correctly in 8bit mode now? Best Regards, Thorsten. Quote
Schrabikus Posted October 30, 2013 Report Posted October 30, 2013 OLED is working fine! A little noisy, but I think you're right, if it's working - no need change anything. 4-bit is good for hardware compatibility, but not so critical. I'm just wanna deal with it to adapt this display to another projects with no possibility of 8-bit connection. Thanks again! Quote
Altitude Posted October 30, 2013 Author Report Posted October 30, 2013 Hmm. This sounds like a good time to take another look at going after an OLED. So for a more standard OLED, all that needs to done is to solder the SMD pads and use the custom LCD driver? Quote
Schrabikus Posted October 30, 2013 Report Posted October 30, 2013 I've made connection diagram if anyone wants to use this cheap and slim module. It's quite noisy. Electrolytic cap (in my case 220uf) soldered to power rails at LED side significantly reduced the noise. ER-OLEDM2002-MBSID_Connection.pdf Quote
Altitude Posted October 30, 2013 Author Report Posted October 30, 2013 (edited) wrt OLED noise: What worked REALLY well for me is to use a separate 5V supply just for the OLED (Wave 1 Rolf suggested this). I just soldered in a 78L05 in the first two pins and added a 0805 100n between them and another 10uF on the other end and it dropped the noise by at least two-thirds. I dont know how well it would work tapping behind a linear vReg (this was on a Shruthi build, the LT1054 has very good noise rejection) but i'll be using that set up when I give the 20x4 OLED another go for my MB6582 since I use a switching 5V vreg there anyway Edited October 30, 2013 by Altitude Quote
Schrabikus Posted October 31, 2013 Report Posted October 31, 2013 I should try this method, thanks! Quote
TK. Posted November 1, 2013 Report Posted November 1, 2013 If 4bit mode is still for interest: you need a different USER_LCD_Data and USER_LCD_Cmd routine, because the one from the src/app_lcd.inc of the MBSID V2 application is only applicable for 8bit mode. USER_LCD_Data should look like:USER_LCD_Data ;; store byte in data latch movwf USER_LCD_LAT_D ;; wait until display unbusy rcall USER_LCD_WaitUnbusy ;; exit if current LCD not available due to timeout btfsc USER_LCD_STATUS, USER_LCD_STATUS_CUR_DISABLED, BANKED return ;; select data register bsf USER_LCD_LAT_RS, USER_LCD_PIN_RS ;; activate write bcf USER_LCD_LAT_RW, USER_LCD_PIN_RW ;; strobe rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr ;; transfer lower 4 bit swapf USER_LCD_LAT_D, F ;; strobe and exit rcall USER_LCD_Strobe_Set rgoto USER_LCD_Strobe_Clr and USER_LCD_Cmd:USER_LCD_Cmd ;; store byte in data latch movwf USER_LCD_LAT_D ;; wait until display unbusy rcall USER_LCD_WaitUnbusy ;; exit if current LCD not available due to timeout btfsc USER_LCD_STATUS, USER_LCD_STATUS_CUR_DISABLED, BANKED return ;; select command register bcf USER_LCD_LAT_RS, USER_LCD_PIN_RS ;; activate write bcf USER_LCD_LAT_RW, USER_LCD_PIN_RW ;; strobe rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr ;; transfer lower 4 bit swapf USER_LCD_LAT_D, F ;; strobe and exit rcall USER_LCD_Strobe_Set rgoto USER_LCD_Strobe_Clr this is untested code! Please also replace the (wrong): movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A movwf USER_LCD_LAT_D rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clr movlw 50 ; 50 ms delay call MIOS_Delay rcall USER_LCD_Strobe_Set rcall USER_LCD_Strobe_Clrby: movlw 0x01 ; /////////////////////CGRAOM 248 COGRAM 8 Select ROM A rcall USER_LCD_Dataand doublecheck later, if 0x09 is maybe the better value Best Regards, Thorsten. Quote
Schrabikus Posted November 3, 2013 Report Posted November 3, 2013 Thanks a lot! Fried last spare OLED with 12v :pinch: , so i'll test this code when new one arrives. Quote
Altitude Posted November 25, 2013 Author Report Posted November 25, 2013 (edited) This actually came up with the PreenFM2 which also uses 4bit mode and the display didnt work out of the gate but Xavier figured it out. Maybe someone who knows what they are doing may find what he said useful: http://ixox.fr/forum/index.php?topic=63350.msg63931#new Edited November 25, 2013 by Altitude Quote
jojjelito Posted November 25, 2013 Report Posted November 25, 2013 That's fantastic news! I hit a snag related to having to support the OLED both in the bootloader, and in the app itself last I checked. Hmm. hopefully there's some time for this during the x-mas break... Quote
Magus517707 Posted March 11, 2014 Report Posted March 11, 2014 Any luck on getting a 4bit driver working for the 20x4 New Haven OLED Display? I'd love to be able to put mine into my newly built MB6582. Quote
jojjelito Posted March 12, 2014 Report Posted March 12, 2014 I think that Scifo and Schrab were in luck with their builds. It would be nice to get a blow-by-blow write up on how to get an OLED rolling. I got frustrated and left the OLED alone to pursue some other DIY projects for the longest. Quote
Schrabikus Posted March 12, 2014 Report Posted March 12, 2014 Jo, I have luck with 8 bit mode and decided to leave it working as is. Another one is still not ordered. I'm in hibernation mode :D Quote
jojjelito Posted March 12, 2014 Report Posted March 12, 2014 :D I saw that Newhaven had revised their datasheets for the 4x20 OLEDs so that the actual jumper section looks like it does on the display. That might be a great way to get one working in 8-bit or 4-bit mode as you see fit... With some luck things will be more calm round here so that I could investigate a bit. Quote
ChinMuzik Posted July 22, 2016 Report Posted July 22, 2016 Has anybody got a 4x20 OLED working in their mb6582 with a step-by-step? I was directed to this thread but seems there is no final conclusion? Quote
Altitude Posted July 22, 2016 Author Report Posted July 22, 2016 i was never able to get it to work Quote
Hawkeye Posted July 26, 2016 Report Posted July 26, 2016 On 22.7.2016 at 8:55 PM, Altitude said: i was never able to get it to work You need a hacking +10 stat in your character sheet to enable OLEDs or VFDs for the MB6582 ;-) Quote
Altitude Posted July 26, 2016 Author Report Posted July 26, 2016 Yeah, there is only so much time I can throw at this. I'm about to give away the rest of my VFDs, I have no use for them Quote
iZZE Posted March 4, 2017 Report Posted March 4, 2017 Ah damn.. i should have checked the forum before buying a Newhaven Oled.. sad part is that i even paid a lot of import duties and shipping for it :( Nobody got it working yet ? :( Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.