Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:42 04 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 : Introducing the Pi-cromite: first steps

     Page 6 of 16    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 09:55pm 22 Apr 2017
Copy link to clipboard 
Print this post

  Quote  A strange 'feature'
entering programs with AUTO


It was on my "to-do" list but low down - however you have prompted me so...

2017-04-23_075541_mmbasic.zip Edited by matherp 2017-04-24
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 02:07pm 23 Apr 2017
Copy link to clipboard 
Print this post

@matherp

Peter,

Did you also note the IR problem and Geoff's fix in external.c detailed in this thread ? I have confirmed that the problem exists in the MZ software.

Regards,
Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 11:53pm 24 Apr 2017
Copy link to clipboard 
Print this post

Please find attached the latest alpha release 5.3a6.

This fixes the bug Jim reported relating to string functions on page 8 of this thread.

2017-04-25_095054_mmbasic.zip

remember you will need to make the program executable once loaded to the Pi

chmod +x mmbasic


you also need to have pigpiod installed on the Pi

sudo apt-get install pigpiod


finally to run the code use

sudo ./mmbasic

 
gumath
Newbie

Joined: 25/04/2017
Location: Austria
Posts: 10
Posted: 10:59pm 25 Apr 2017
Copy link to clipboard 
Print this post

Hello all "MM" enthusiastically

I'm new here, but I've been reading this forum for a long time.

First many, many, thanks to Geoff and Matherp, for MM_Basic, and
TassyJim for MMedit, mostly I use "170", 28Pin)

But now to my problem with basic on the raspberry pi3,
No matter what program I start,

For example, two LEDs flash alternately,
 
Runs perfectly, but only a certain time, about 30 to 60 minutes, then stood still,
Without a fault message.
Then ctrl_c, and enter run, the program runs until it resounds after a certain
I can always repeat.

At two different rapberrys, once pi3 with keyboard and screen and
Jessie full version, the second with Jessie Lite over SSH on a WIN10_PC.
Both behave the same.
Please someone can help me?

Since my English is very bad, I have google translate this text
Written, excused

Thank you and vy 73 de, guenter, oe7gmt Edited by gumath 2017-04-27
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 02:15am 26 Apr 2017
Copy link to clipboard 
Print this post

Hi

Thanks for the report. The code is an "alpha" so I'm not too surprised there are some issues. Does this still happen with 5.3a6? There a number of changes in that version that could change and possibly improve the symptoms you report.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 02:17am 26 Apr 2017
Copy link to clipboard 
Print this post

Hi

Thanks for the report. The code is an "alpha" so I'm not too surprised there are some issues. Does this still happen with 5.3a6? There a number of changes in that version that could change and possibly improve the symptoms you report.

UPDATE

I assume you were using PAUSE in your program? I've found a possible issue in the pause command when the 32-bit microsecond timer overflows back to zero which happens every 71 minutes. I'm testing this at the moment and will post an update when I'm happy with it.

Edited by matherp 2017-04-27
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 10:37am 26 Apr 2017
Copy link to clipboard 
Print this post

Attached is 5.3a7. This fixes a bug in a PAUSE statement that is running when the microsecond clock resets to zero every 71 minutes.

2017-04-26_203331_mmbasic.zip

My test program has been running for 4 hours without problem whereas in a6 it stopped in a PAUSE statement.

Dim integer a
SetPin 40,dout
Do
Pin(40)=1
Pause 200
Pin(40)=0
Pause 200
a=a+1
Print ".";
If a Mod 80=0 Then Print ""
Loop
 
gumath
Newbie

Joined: 25/04/2017
Location: Austria
Posts: 10
Posted: 12:49am 27 Apr 2017
Copy link to clipboard 
Print this post

@ Matherp

Hi Peter,

In version 5.3a6, all PAUSE commands have been replaced by FOR / NEXT loops,
Went through the whole night without interruption.

Now test version 5.3a7, with PAUSE command, runs a few hours
Through, without interruption.

Thank you for the quick reaction of my problem.

I'm looking forward to testing more versions.

With MM_BASIC, on the Raspberry, a dream has come true,
Thanks again for the many time you spent on this project
have.

Thanks again,
Vy 73 de Guenter, OE7GMT
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 07:35am 27 Apr 2017
Copy link to clipboard 
Print this post

Now with added I2C

Version 5.3a8 attached:

2017-04-27_173102_mmbasic.zip

Before using I2C the pins to be used must be selected with

[code]OPTION I2C SDApinno, SCLpinno

To use the default Pi pins this would be

OPTION I2C 3,5


The pins selected are stored in the hidden file .options and only need to be entered once. They can be changed by using OPTION I2C DISABLE and then re-defining them.

Then you can use I2C exactly the same as the Micromite with the following limitations:

The implementation does not support 10-bit addressing (i.e. options 0 and 1 only)
The implementation is Master only.

My test program for reading data from a DS3231 is below

I2C open 400,1000
Dim a(6)
I2C write &H68,0,1,0
I2C read &H68,0,7,a()
For i=0 To 6
Print Hex$(a(i))
Next i
Print MM.I2C
I2C close




 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 327
Posted: 03:28pm 27 Apr 2017
Copy link to clipboard 
Print this post

Just started playing with the Pi Zero W and have a question... Why does TIMER return negative values?

--Curtis


I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 09:53pm 27 Apr 2017
Copy link to clipboard 
Print this post

  Quote   Why does TIMER return negative values?


It is either:
A:/ MMBasic on the Pi is so fast that due to quantum effects time appears to run backwards
B:/ A bug

Try the attached 5.3a9 for the fix

2017-04-28_075315_mmbasic.zip
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 06:45am 28 Apr 2017
Copy link to clipboard 
Print this post

Hi Peter,

I have hooked up an 2.8" ILI9341 to the RPi Zero W and all works.

However, the speed seems slow for things such as CLS (slower than a 28pin BackPack). Is this something you would expect at this stage of your 'port'? OR is there something I may be doing incorrectly.

Am using OPTION ILI9341,L,22,24,26 as the setup/pins.

WW

EDIT - Using version ...a9 aboveEdited by WhiteWizzard 2017-04-29
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 07:40am 28 Apr 2017
Copy link to clipboard 
Print this post

  Quote  However, the speed seems slow for things such as CLS (slower than a 28pin BackPack)


The MM code has some clever optimizations that run the SPI channel continuously with no wait states. At the moment the Pi outputs one byte at a time this can certainly be improved but is not at the top of the list

Attached is release 5.3a10

2017-04-28_173336_mmbasic.zip

This now includes full IR support (IR send and IR receive) as per the MM.
IR receive is on pin 16 on the Pi. IR send can be any pin.
Also PEEK and POKE are now properly implemented with all the options listed in the MM manual except CFUNADDR. POKE is restricted to changing variable space (simple variables or arrays and strings). PEEK can look at both the variable space and the program space.

Attached is tested code for the Pi for reading a BMP180 on I2C. This is a more rigorous test of the I2C support than the simple code posted above.

2017-04-28_173534_bmp180.zip




 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 10:51am 28 Apr 2017
Copy link to clipboard 
Print this post

Hi matherp

I'm trying your latest version "2017-04-28_173336" on Raspbeery Pi 3 and at start I have this error:

------------------------------------
LINUX MMBasic Version 5.3a10
Copyright 2011-2017 Geoff Graham
Copyright 2017 Peter Mather

Error: Pin 0 is invalid
Segmentation fault
------------------------------------

I think it's useful for you
Thanks and good job
sagt3k
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 10:57am 28 Apr 2017
Copy link to clipboard 
Print this post

Same here with Error: Pin 0 is invalid (but I'm not getting the line about 'Segmentation fault')

FYI - I had an ILI 9341 configured and simply overwrote the MMBASIC file (and did the 'chmod' command prior to running)

WW
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10196
Posted: 08:36pm 28 Apr 2017
Copy link to clipboard 
Print this post

  Quote  Same here with Error: Pin 0 is invalid


Ooops: didn't happen if you had OPTION I2C set so I didn't see it.
Trying to clear the I2C pins when they weren't set up

Fixed in 5.3.a11 below

2017-04-29_063634_mmbasic.zip
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 08:46pm 28 Apr 2017
Copy link to clipboard 
Print this post

THANKS Peter (didn't you sleep again last night!).

Will load straight away . . . .
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 08:59pm 28 Apr 2017
Copy link to clipboard 
Print this post

FEEDBACK:

Loaded ok - ran ok.

BUT when I incorrectly typed RUN (forgetting I had to load a program first) it said Error: Pin 19 is reserved on startup.

Typed the name of my program (ILI_Timer.bas) but gave an Error: Unknown command.

Repeated it and no error BUT also not loaded (as LIST revealed nothing)

Typed: Load "ILI_Timer.bas" and Error: Pin 19 is reserved on startup

OPTION LIST shows the ILI is still configured after overwriting MMBASIC a9 with a11 (i.e. I have not set up the TFT in a11)

I will try disabling, then re-configuring TFT

WW
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 09:04pm 28 Apr 2017
Copy link to clipboard 
Print this post

Had trouble 'DISABLING LCDPANEL' - had to CTRL-Z and go back in then type OPTION LCDPANEL DISABLE. All other attempts kept giving the PIN19 reserved on startup.

Upon redefining it, I was ale to load program (LIST showed something) BUT when I run it it gave the PIN19 error again. I am using 22,24,26 as the 'optional' pins for the ILI.

Pin 19 is MOSI so guess there is an 'internal issue'

WW
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 09:05pm 28 Apr 2017
Copy link to clipboard 
Print this post

Hi matherp

I confirm that with new version "2017-04-29_063634" now mmbasic for RaspyPI3 is working.
Two questions:
- I2C work as master and slave ?
- Can I start external process as bash etc and Can I read output results ?

Thanks
sagt3k
 
     Page 6 of 16    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025