Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:56 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : I2C Support needed

     Page 1 of 3    
Author Message
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 10:57am 28 Sep 2021
Copy link to clipboard 
Print this post

Hi all around.

Could somebody please give me a simple but working "Hello World" like this but in MMBASIC
https://www.hackster.io/newproject/how-to-use-lcd-i2c-30bbf0
my LCD-Adress also is "27"

Being so easy for Arduinos I am really stucked right here.
Andre ... such a GURU?
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 11:06am 28 Sep 2021
Copy link to clipboard 
Print this post

EDIT: erased, I have misread the question, I do not have a I2C LCD.
Edited 2021-09-28 21:09 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 11:07am 28 Sep 2021
Copy link to clipboard 
Print this post

Thanks, I will check it out!

Andre ... such a GURU?
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 11:09am 28 Sep 2021
Copy link to clipboard 
Print this post

But wait, this is not the I2C access to it, just the parallel way.
Andre ... such a GURU?
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 11:13am 28 Sep 2021
Copy link to clipboard 
Print this post

I am just running such a module on a 16X2 LCD

https://andjey.info/wp-content/uploads/2021/03/arduino-i2c-module-1024x486.jpg

the successfully scanned address is "27"
Andre ... such a GURU?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 12:06pm 28 Sep 2021
Copy link to clipboard 
Print this post

I think this should work, in theory. :)
I've not tested it on the PicoMite, but I found it among some stuff that I'd saved.

SETPIN gp0, gp1, I2C  'SDA is GP0, SCL is GP1

'Initialise
LCDI2C_Init(&h27)

Do
LCDI2C 1,3,Date$
LCDI2C 2,4,Time$
Loop

EDIT:
Ah! Hang on...
The PicoMite doesn't support I2C serial text displays in firmware.
The above requires LCDI2CLib to be installed. I found it on this forum somewhere - it's pretty old. It was first posted here:
https://www.thebackshed.com/forum/ViewTopic.php?TID=6715&PID=70291#70291#70291

.
.
.
Edited 2021-09-28 22:36 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:34pm 28 Sep 2021
Copy link to clipboard 
Print this post

I used a 128x64 I2C LCD instead of 16x2, but there's I2C code for it in the sensors.zip file.

For that, OPTION LCDPANEL SSD1306i2c,L was needed. I don't see that 16x2 I2C is supported (but I may be missing something).
Edited 2021-09-28 22:43 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 12:37pm 28 Sep 2021
Copy link to clipboard 
Print this post

My link didn't work.  :(

https://www.thebackshed.com/forum/ViewTopic.php?TID=6715&PID=70291#70291#70291

Completely different beastie, lizby. Poppy has a text display, not a graphic one.
Edited 2021-09-28 22:39 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 12:45pm 28 Sep 2021
Copy link to clipboard 
Print this post

Exactly, just a text display those having a HD44780 Controller.
And it is not a Picomite, just a CMM2 Gen 2 (Vers.: 5.07.01)

I am just getting no access to this issue so therefore I need some basic support for finding the first step.
Andre ... such a GURU?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 01:21pm 28 Sep 2021
Copy link to clipboard 
Print this post

You'll need the library that I mentioned. Have a look through that thread - I think it got up to about version 7 but you may not need all the facilities. Just load the library and have a look through it - it's only MMBasic and well commented.

Have a look at the CMM2 manual in Appendix B (I think) on I2C communication. That should help in opening & closing an I2C channel. You probably won't be able to use the version in the library because that was written for the micromite.

I'll have a look round - I *think* I had a text I2C display running on a PicoMite at one stage. It'll be very similar to the CMM2, probably only setting up the I2C will be different.

EDIT:
I can't test this at present, but I think it will run "as is" if you change Sub LCDI2C_Init() to use I2C OPEN 400,100 instead of I2C1 OPEN 400,100.
i2c1 1602.zip
Edited 2021-09-28 23:36 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 01:32pm 28 Sep 2021
Copy link to clipboard 
Print this post

F++++ck!

Forum is bothering me out, cannot answer!
Andre ... such a GURU?
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 01:38pm 28 Sep 2021
Copy link to clipboard 
Print this post

No chance for longer replies!
Andre ... such a GURU?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 01:39pm 28 Sep 2021
Copy link to clipboard 
Print this post

Try pasting from Notepad. It might work...
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 01:44pm 28 Sep 2021
Copy link to clipboard 
Print this post

Nope, pasting NEVER works for me at least. I already tried to do it with plain text, does not matter.
After the error appeared once I cannot do anything about it and the finished text is lost. This has been for several months already, so nothing new.
Since the new setup of the forum.
Andre ... such a GURU?
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 01:48pm 28 Sep 2021
Copy link to clipboard 
Print this post

So it is still a pure matter of luck to post succesfully or not.
Long postings are always risky to get invalidated. Shorts as well, but they can be typed again easily.
Andre ... such a GURU?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 02:05pm 28 Sep 2021
Copy link to clipboard 
Print this post

Oh! I wasn't aware that the forum setup had changed. :(
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 02:44pm 28 Sep 2021
Copy link to clipboard 
Print this post

Forum setup did change eliminating some possibly hostile or corrupting character combinations, but I don't know why plain text copied from notepad without any special characters should fail--it doesn't for me.

Lengthy text copies from other sources I usually pass through notepad first to eliminate the problem.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 03:01pm 28 Sep 2021
Copy link to clipboard 
Print this post

I usually type a relatively short message, and post it. (Long messages also time out). And then I edit until I have achieved the total message (do not refresh the page, becuase if someone adds a post after you, the edit function disappears). But (and this happened to me in post #2 of this thread) sometimes people already read the incomplete short message and act on it. That is most unwelcome.

Pasting from notepad (windows) and leafpad (linux) works for me. Not sure why yours does not. Never tried pasting from Word, since it may throw a lot of formatting info.
Edited 2021-09-29 01:02 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 03:08pm 28 Sep 2021
Copy link to clipboard 
Print this post

Would Poppy's German keyboard (I assume) send illegal code combinations for normal ASCII characters? I wouldn't have thought so.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Poppy

Guru

Joined: 25/07/2019
Location: Germany
Posts: 486
Posted: 03:46pm 28 Sep 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  Would Poppy's German keyboard (I assume) send illegal code combinations for normal ASCII characters? I wouldn't have thought so.


Good point

it is a Microsoft-Keyboard

PS: I just corrected my rejected posting and it went through
new experience for me
still some tasks to check up
Edited 2021-09-29 01:47 by Poppy
Andre ... such a GURU?
 
     Page 1 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025