Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:59 25 Nov 2024 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 : Sending a source file to the PicoMite

Author Message
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 857
Posted: 03:56pm 31 May 2024
Copy link to clipboard 
Print this post

I realise that I should already know this but:


If I have my MMBasic source file on my Tablet and I want to send it to the PicoMite via Bluetooth serial, what kind of header do I need to send?

I understand that the file needs to be terminated with ctrl-z, right?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6783
Posted: 04:07pm 31 May 2024
Copy link to clipboard 
Print this post

The PicoMite deals in pure ASCII. You can't send it bluetooth directly anyway, you'll need a suitable receiver (HC summat or other IIRC) and then convert to 3V3 TTL to feed a COM port set up as the console. At that stage whatever you send from the tablet should appear on the PicoMite, I think. AFAIK there are no special headers or anything, it's just ASCII text as if you were typing via a terminal.
Mick

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

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2075
Posted: 04:28pm 31 May 2024
Copy link to clipboard 
Print this post

at the prompt, type

>AUTOSAVE <CR>

the mite then goes into listen mode and will take everything that arrives as program.

You terminate with CTRL-Z as you state above. There  will be a momentary pause as everything is copied to flash and then you get yur prompt back... you should be able to LIST what you just sent and if you dare RUN it  

h
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 04:39pm 31 May 2024
Copy link to clipboard 
Print this post

You will need a wired connection to setup the com port, and configure it as console.

Volhout
PicomiteVGA PETSCII ROBOTS
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 857
Posted: 06:08pm 31 May 2024
Copy link to clipboard 
Print this post

@Mixtel90:
Understood; I've being bluetoothing program data to the Mite for a long time now. Now I wanna send the actual prog.

@CaptainBoing: Thanks Cap'n. Presumably the AUTOSAVE <CR> can be the first line of the text file...or would I need a delay?

@Volhout: Oh yeah, already understood that but now comes another question that I should know the answer to:

Let's say the com port wasn't the console and I simply received the source and stored it in drive a:
Is there a mechanism within MMBasic to load it and become the active program? Like RUN or CHAIN or something? But have it become the startup program?
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1241
Posted: 06:29pm 31 May 2024
Copy link to clipboard 
Print this post

  PhenixRising said  ... @CaptainBoing: Thanks Cap'n. Presumably the AUTOSAVE <CR> can be the first line of the text file...or would I need a delay? ...

No, this (AUTOSAVE <CR>) should be entered at the prompt on the Picomite.
Regards
Michael

From manual p86:
  Quote  AUTOSAVE
or
AUTOSAVE CRUNCH
Or
AUTOSAVE APPEND
Enter automatic program entry mode. This command will take lines of text
from the console serial input and save them to program memory.
This mode is terminated by entering Control-Z or F1 which will then cause the
received data to be transferred into program memory overwriting the previous
program. Use F2 to exit and immediately run the program.
The CRUNCH option instructs MMBasic to remove all comments, blank lines
and unnecessary spaces from the program before saving. This can be used on
large programs to allow them to fit into limited memory. CRUNCH can be
abbreviated to the single letter C.
The APPEND option will leave the existing program intact and append the
new data from the serial input to the end of it.
At any time this command can be aborted by Control-C which will leave
program memory untouched.
This is one way of transferring a BASIC program into the PicoMite. The
program to be transferred can be pasted into a terminal emulator and this
command will capture the text stream and store it into program memory. It can
also be used for entering a small program directly at the console input.

Edited 2024-06-01 04:31 by twofingers
causality ≠ correlation ≠ coincidence
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2075
Posted: 07:24pm 31 May 2024
Copy link to clipboard 
Print this post

  Volhout said  You will need a wired connection to setup the com port, and configure it as console.


... or you could connect the console Rx/Tx to the BT adaptor - I have done similar with HC-12s (433MHz jobbies) with no issues. Does like a slow baud rate for uploading new software otherwise you get gaps, but fine for console interaction.

@Phenix : yes you can put the AUTOSAVE as the first line, whether it needs a delay as the 2040 "set's up"... dunno, suck it and see and report back... you could try adding a few more blank lines after the AUTOSAVE I spose.

You can also embed the CTRL-Z in the text file - I do this a lot to speed up development - I mainly use MicroMites (PIC32MX170 based) and I always transfer new software to them using AUTOSAVE, so when the file transfers, it automatically saves and I have an embedded RUN after the CTRL-Z. this might not work over BT... but there is a buffer on the console... so it might... see above about sending too fast. YMMV - the RPi can probably keep up better than my little 48MHz specimens.

There is a very nice set of terminal progs for Android that use BT (or USB) by a guy called Kai Morich, search for  "Serial Bluetooth Terminal" - unless you have iOS in which case I can't make a recommendation.

example from one of my files (editor=Notepad++):



h
Edited 2024-06-01 05:44 by CaptainBoing
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2075
Posted: 07:52pm 31 May 2024
Copy link to clipboard 
Print this post

  twofingers said  
No, this (AUTOSAVE <CR>) should be entered at the prompt on the Picomite.


all depends on how you interpret the console... or have I misunderstood?

assuming the BT adaptor is connected to the Rx/Tx of the console, it works.

I wrote a quick text file:



and pasted it into the console...



The MM went into autosave mode, uploaded the file, saved it and ran it in a single operation. The 'mite has no way of telling where the characters came from when they turn up in the console, so it can't tell that you didn't type AUTOSAVE<CR>, it just dutifully interprets the stream of text and acts accordingly.

In fact, it had never occurred to me to do this, I might start doing all the time to cut out a step in my uploading when developing - I can literally cut and paste between the editor and the console.

h
Edited 2024-06-01 06:04 by CaptainBoing
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 857
Posted: 08:44pm 31 May 2024
Copy link to clipboard 
Print this post

One of the reasons I like BT (SPP profile) is that; it's totally transparent. IOW a wireless wire, just like wiring UARTs together.
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1241
Posted: 09:37am 01 Jun 2024
Copy link to clipboard 
Print this post

  CaptainBoing said  
and pasted it into the console...


Very tricky! Thank you1  
Autosave.zip
I can confirm it works with PicoMites too.
Best regards
Michael
causality ≠ correlation ≠ coincidence
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 09:51am 01 Jun 2024
Copy link to clipboard 
Print this post

A number of the programs which vegipete has posted have begun with AUTOSAVE and ended with Ctrl-Z. I don't remember whether or not they have also had a RUN at the end.

I remember learning the CUT F10 (AUTOSAVE) PASTE CTRL-Z method from one of the Cap't's posts a good many years ago, with notepad++ as the editor on the PC. Very satisfactory coding flow for me.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2075
Posted: 12:09pm 01 Jun 2024
Copy link to clipboard 
Print this post

  lizby said   the CUT F10 (AUTOSAVE) PASTE CTRL-Z method... Very satisfactory coding flow for me.


and for me also, I only load software that way - and now, I do it with the AUTOSAVE at the top - it makes deploying from the editor a sub-second process - excluding the screen-scrolling while the code loads (I am so lazy)  

I hadn't seen it done anywhere else, but hat-tip to vegipete

h
Edited 2024-06-01 22:25 by CaptainBoing
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 12:56pm 01 Jun 2024
Copy link to clipboard 
Print this post

Another option is to use TassyJim's MMEdit. Just click the Run icon and your program gets loaded and runs.
Just one click, nothing extra to type.

To aid your creativity it has optimizations for all MMBasic devices.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2075
Posted: 08:24pm 01 Jun 2024
Copy link to clipboard 
Print this post

yes it is a very good devkit and I would use it if I didn't need my tool chain to be agnostic
 
Print this page


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

© JAQ Software 2024