Adventures with I2C & Minerva Mk2

Anything QL Software or Programming Related.
User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

Thanks to Ql_freak’s tutorial on debugging an sbasic function in another thread I’ve been able to confirm that the data I was sending exactly matches what i2c_io sends for the same command sequence

No idea what’s going on, will keep trying when I have time


User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

Not getting any errors now

But also not getting any speech…


User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

Finally got the test code working properly

Is there a preferred method for getting some workspace memory so I can build the full command string please? The i2c_io just uses the command “as is” in the stack but that’s not an option for me as I need to wrap the text in a command structure to duplicate i2c_io. This could need to be a fairly large buffer if there’s a lot of text to read out

I also need to find some sample code for returning a value from a function. Not done that before
EDIT: forgot about Norm's assembly book, will get return code from there

Many thanks
Tony


User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

t0nyt wrote: Wed Sep 10, 2025 4:52 pm Going back to the AT24C256 (32KB) device

No idea what's going on with the "ghost" address though and nothing I can do about it as far as I know
Well, seem to have solved this mystery

I purchased just a replacement IC to fit into one of those boards and the "ghost" device has vanished!

The boards must come with knock off IC's

Just got to decide if it's worth buying more to fix all/some of the other boards


User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

t0nyt wrote: Tue Sep 16, 2025 9:41 am Is there a preferred method for getting some workspace memory so I can build the full command string please? The i2c_io just uses the command “as is” in the stack but that’s not an option for me as I need to wrap the text in a command structure to duplicate i2c_io. This could need to be a fairly large buffer if there’s a lot of text to read out
Many thanks
Tony
The more I read the more it seems there is no real size limit for the arithmetic stack other than available memory?

Thanks
Tony


User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

Have got the i2c_say text-to-speech extension nearly completed

I had to split the numeric parameter commands into a separate command i2c_say_cmd (sorry Dave, but I’ll revisit this later)

The only thing still to do is to replace the DS.B work buffer with using space on the maths stack!

I think a small help file is also needed, not sure whether to build in a help command or some form of document


User avatar
t0nyt
QL Wafer Drive
Posts: 1218
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Adventures with I2C & Minerva Mk2

Post by t0nyt »

I decided to put the new extension to the test

So added the following code snippet to Dilwyn's port of the Dracula adventure and replaced most of the "PRINT #0," with "PRINT0" and it works a treat speaking all the phrases until I got bitten and killed by Dracula! (if making a proper version I'd take a bit longer over the print #0 replacements though)

BUT When I got bitten the text "Sorry! Dracula just bit you!" started but was interrupted by the ""Sorry, but you didn't win." speech audio

So that shows I'll need to add either a new function to report back if the previous speech has finished, or add a command to just wait until text has finished. Or maybe an extra parameter to I2C_SAY for true/false to wait or not. Any thoughts on this please?

Code: Select all

5760 DEFine Procedure PRINT0(txt)
5770 PRINT #0,txt
5780 I2C_SAY txt
5790 END DEFine PRINT0
Am still using a 512 byte text buffer within the extension until I can work out the best way to use CHRIX for this


Post Reply