Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:33 12 Jul 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 : [PM] how to post on Fruit of the Shed

Author Message
chipveres
Newbie

Joined: 28/12/2024
Location: United States
Posts: 5
Posted: 07:51pm 09 Jan 2025
Copy link to clipboard 
Print this post

I have written a one-page BASIC program to display "HELLO" on a
hd44780 LCD with a PCF8574 i2c bus expander.  The program's purpose is to teach or learn.  It reads straight top to bottom without calling any subroutines.  I would like to post it on Fruit of the Shed.  How do I do that?
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2610
Posted: 09:25pm 09 Jan 2025
Copy link to clipboard 
Print this post

While waiting for that information perhaps post it in your original thread.
There is bound to be someone on TBS that would find it useful.
 
chipveres
Newbie

Joined: 28/12/2024
Location: United States
Posts: 5
Posted: 05:12pm 10 Jan 2025
Copy link to clipboard 
Print this post

'write "HELLO" from PicoMite to HD44780 via PCF8574
' pcf8574 pins in order: D7,D6,D5,D4,BL,E,RW,RS
'from the HD44780 data sheet

setpin gp2,gp3,i2c2 'where the sigs come out
i2c2 open 100,100 '100 KHz wait 100 mS
pause 100 ' for power to come up

i2c2 write &h27,0,1,&b00100000 :pause 1 'function set e lo
i2c2 write &h27,0,1,&b00100100 :pause 1 ' flip e hi
i2c2 write &h27,0,1,&b00100000 :pause 1 'e trailing edge sends data

i2c2 write &h27,0,1,&b00100000 :pause 1 'function set e lo
i2c2 write &h27,0,1,&b00100100 :pause 1 ' flip e hi
i2c2 write &h27,0,1,&b00100000 :pause 1 'e trailing edge sends data


i2c2 write &h27,0,1,&b00000000 :pause 1 'second function set
i2c2 write &h27,0,1,&b00000100 :pause 1 'flip e hi
i2c2 write &h27,0,1,&b00000000 :pause 1 'e back lo

i2c2 write &h27,0,1,&b00000000 :pause 1 'third function set
i2c2 write &h27,0,1,&b00000100 :pause 1 'flip e hi
i2c2 write &h27,0,1,&b00000000 :pause 1 'e back lo


i2c2 write &h27,0,1,&b11100000 :pause 1 'display on off
i2c2 write &h27,0,1,&b11100100 :pause 1 'flip e hi
i2c2 write &h27,0,1,&b11100000 :pause 1 'e back lo

i2c2 write &h27,0,1,&b00000000 :pause 1 'entry mode set
i2c2 write &h27,0,1,&b00000100 :pause 1 ' flip e hi
i2c2 write &h27,0,1,&b00000000 :pause 1 ' e down to send data

i2c2 write &h27,0,1,&b01100000 :pause 1 'more entry mode set
i2c2 write &h27,0,1,&b01100100 :pause 1 ' flip e hi
i2c2 write &h27,0,1,&b01100000 :pause 1 'e back lo

'now write a character LSB hi is character, not control.

i2c2 write &h27,0,1,&b01000001 :pause 1 'hi nibble of capital H
i2c2 write &h27,0,1,&b01000101 :pause 1 'flip e hi
i2c2 write &h27,0,1,&b01000001 :pause 1 'e back lo to send

i2c2 write &h27,0,1,&b10000001 :pause 1 'lo nibble of capital H
i2c2 write &h27,0,1,&b10000101 :pause 1 ' flip e hi
i2c2 write &h27,0,1,&b10000001 :pause 1 ' e lo to send

i2c2 write &h27,0,1,&b01000001 :pause 1 'hi nibble of capital E
i2c2 write &h27,0,1,&b01000101 :pause 1 'flip enable hi
i2c2 write &h27,0,1,&b01000001 :pause 1 'enable lo to send

i2c2 write &h27,0,1,&b01010001 :pause 1 'lo nibble of capital E
i2c2 write &h27,0,1,&b01010101 :pause 1 'flip enable hi
i2c2 write &h27,0,1,&b01010001 :pause 1 ' enable lo send

i2c2 write &h27,0,1,&b01000001 :pause 1 'hi nibble of capital L
i2c2 write &h27,0,1,&b01000101 :pause 1 'flip enable hi
i2c2 write &h27,0,1,&b01000001 :pause 1 'lo to send

i2c2 write &h27,0,1,&b11000001 :pause 1 'lo nibble of capital L
i2c2 write &h27,0,1,&b11000101 :pause 1 'enable hi
i2c2 write &h27,0,1,&b11000001 :pause 1 'enable lo

i2c2 write &h27,0,1,&b01000001 :pause 1 'hi nibble of 2nd capital L
i2c2 write &h27,0,1,&b01000101 :pause 1 'flip enable hi
i2c2 write &h27,0,1,&b01000001 :pause 1 'lo to send

i2c2 write &h27,0,1,&b11000001 :pause 1 'lo nibble of 2nd capital L
i2c2 write &h27,0,1,&b11000101 :pause 1 'enable hi
i2c2 write &h27,0,1,&b11000001 :pause 1 'enable lo

i2c2 write &h27,0,1,&b01000001 :pause 1 'hi nibble of capital O
i2c2 write &h27,0,1,&b01000101 :pause 1 'enable hi
i2c2 write &h27,0,1,&b01000001 :pause 1 'lo to send

i2c2 write &h27,0,1,&b11110001 :pause 1 'lo nibble of capital O
i2c2 write &h27,0,1,&b11110101 :pause 1 'enable hi
i2c2 write &h27,0,1,&b11110001 :pause 1 'lo to send

'turn on backlight
i2c2 close
setpin gp2, gp3, i2c2
i2c2 open 100,100 '100 KHz, wait 100 ms
i2c2 write &h27,0,1,&b0001000
i2c2 close
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3358
Posted: 06:53pm 10 Jan 2025
Copy link to clipboard 
Print this post

  chipveres said  I would like to post it on Fruit of the Shed.  How do I do that?


Go here: FruitOfTheShed

For info, click Getting an Account

(Note: "On the TBS forum send a PM to disco4now requesting access, include your email address if its not viewable in your TBS membership details")

Getting Started: "Have a read of the various pages in the Wiki 101 namespace to see how to create or update a page/article" Wiki 101

Welcome to the shed and thanks for posting your code. Note that if you code has indentations to make it easier to read, you can preserve that formatting by clicking the icon ["-"] above the text window, or enclosing it in [ CODE] and [ /CODE] tags (upper case only, and without the " " following "[").

~
Edited 2025-01-11 04:55 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
chipveres
Newbie

Joined: 28/12/2024
Location: United States
Posts: 5
Posted: 09:59pm 10 Jan 2025
Copy link to clipboard 
Print this post

NB:  I should clarify that there is a level converter between the PicoMite and the HD44780.  The PM runs on 3.3 volts and the HD44780 on 5.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1360
Posted: 01:14pm 11 Jan 2025
Copy link to clipboard 
Print this post

MMBasic is the gift that keeps on giving, full of surprises and Easter eggs.

FOTS is a great place to share tips and tricks, code samples, etc.

I would also like to contribute to this as I discover new capabilities.

I am seriously challenged in the math department and I am sure that I could put some of the low-level math functions to good use but I can only relate to examples.

Thoughts?
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1360
Posted: 01:14pm 11 Jan 2025
Copy link to clipboard 
Print this post

Duplicate
Edited 2025-01-11 23:16 by PhenixRising
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025