Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:08 19 May 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 : Comms using Linux and ’EDIT’

Author Message
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 11:28am 14 Dec 2014
Copy link to clipboard 
Print this post

I'm using the simple 28 pin device with MMBASIC pre programmed into it.

Now comms into the device was a bit of a challenge as minicom thought it was an old fashioned modem *LOL*

But Picocom worked brilliantly. A few snags such as function keys not working, but using control codes overcame that.

The version of linux is XUBUNTU running on a 10 year old Thinkpad Laptop.

Now all is well, but a snag has come up . (I have been using Kate as an editor for years.)

Now when in 'Edit' I can copy the program I have written and tested, pop it into Kate so I can print it. But I can't paste it back into edit.

Now I'm used to doing a 'Save As...' on the many variants of a program I'm developing as I add features. But I've not discovered how to from within 'Edit' how to directly save a program or how to reload a program once saved.

So the question is... Is it possible and how to do it, if it is possible ?

Many thanks for any thoughts on this matter.



Tim

Edited by Tim036 2014-12-15
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 12:29pm 14 Dec 2014
Copy link to clipboard 
Print this post

Look into the autosave function.
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 01:53pm 14 Dec 2014
Copy link to clipboard 
Print this post

  cwilt said   Look into the autosave function.


Many thanks, I'll try that out tomorrow.



Tim
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 11:50am 16 Dec 2014
Copy link to clipboard 
Print this post

The manual says this about 'Autosave'

Enter automatic program entry mode.
This command will take lines of text from the console serial input and save
them to memory. This mode is terminated by entering Control-Z which will
then cause the received data to be saved into program memory overwriting
the previous program.
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 Micromite. 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.

end quote

I can copy and paste one line aok but a block of code gets trashed.

So the problem is not solved.



Tim


 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 12:54pm 16 Dec 2014
Copy link to clipboard 
Print this post

Tim,
You need to have a delay between each line being pasted.
TeraTerm (Windows), has a setting to do this.
The terminal program you are using might (hopefully) have an option to put a line delay in also.

Jim

VK7JH
MMedit   MMBasic Help
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 01:04pm 16 Dec 2014
Copy link to clipboard 
Print this post

> I can copy and paste one line aok but a block of code gets trashed.

Just RUN it. The MicroMite saves everything ran.
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 03:41pm 16 Dec 2014
Copy link to clipboard 
Print this post

  TassyJim said   Tim,
You need to have a delay between each line being pasted.
TeraTerm (Windows), has a setting to do this.
The terminal program you are using might (hopefully) have an option to put a line delay in also.

Jim


Hi Jim,

would a series of tabs do the job ? (Update :- No it does not)

Many thanks for responding !



Tim

GW1JOVEdited by Tim036 2014-12-18
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 04:26pm 16 Dec 2014
Copy link to clipboard 
Print this post

  Tim036 said  

would a series of tabs do the job ?

Tim

GW1JOV

I doubt it.

I couldn't see an obvious setting for line speed in picoterm so you may have to find an alternative program.

If you can run Wine, and are willing to do so, TeraTerm or MMEdit are worth trying.
Rather than use Wine's serial port translation, I find ser2net works well and then either program can connect by TCP/IP to localhost.

Jim VK7JH

VK7JH
MMedit   MMBasic Help
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 07:59pm 16 Dec 2014
Copy link to clipboard 
Print this post

  TassyJim said  
  Tim036 said  

would a series of tabs do the job ?

Tim

GW1JOV

I doubt it.

I couldn't see an obvious setting for line speed in picoterm so you may have to find an alternative program.

If you can run Wine, and are willing to do so, TeraTerm or MMEdit are worth trying.
Rather than use Wine's serial port translation, I find ser2net works well and then either program can connect by TCP/IP to localhost.

Jim VK7JH
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 08:04pm 16 Dec 2014
Copy link to clipboard 
Print this post

I can develop one program and copy and paste into Kate using Linux. Them swich to Windows 7 when I want to load it back in.

All my hard drives are in cradles so I can change OS easily.

A bit clumpy but minimum hassle.

Many many thanks for your help, Jim.



Tim
 
cwilt
Senior Member

Joined: 20/03/2012
Location: United States
Posts: 147
Posted: 02:37pm 18 Dec 2014
Copy link to clipboard 
Print this post

Try PuTTY. I had good luck entering code with it although I did not try to load code with it.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3678
Posted: 11:45pm 18 Dec 2014
Copy link to clipboard 
Print this post

Can you send using XModem? Linux has apps for that.

John
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 11:23am 19 Dec 2014
Copy link to clipboard 
Print this post

Many thanks for your help ! Meanwhile I got slightly sidetracked by trying to get more familiar with programming language it has.

I'm very very rusty so I've stuck as to the syntax of writing a very simple subroutine to pass a number from the main body of the code to a subroutine.

Could anyone post a very simple example of the code that does this ?

(All I get is error messages *LOL*)

Sorry to ask such a 'noddy' question.



Tim
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 12:29pm 19 Dec 2014
Copy link to clipboard 
Print this post

The first sticky in this section points to a number of reference sites that should give plenty of examples. You can safely ignore any of the CFUNCTIONS for now.

This is a simple example of a SUB:
' subroutine demo
test1$="abcdefghijg"
test2$="abcde"
print test1$;" "; test2$
samelen test1$, test2$
print test1$;" "; test2$

end

Sub samelen (a$, b$) ' pads the shorter variable with leading zeros
local dif, z$
dif=Abs(Len( a$ )-Len( b$ ))
z$=String$(dif,"0")
If Len( a$ ) < Len( b$ ) Then
a$ = z$+a$
Else
b$ = z$+b$
EndIf
End Sub


Showing us the code you are having problems with will help...

Jim
VK7JH
MMedit   MMBasic Help
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 03:31pm 19 Dec 2014
Copy link to clipboard 
Print this post

  TassyJim said   The first sticky in this section points to a number of reference sites that should give plenty of examples. You can safely ignore any of the CFUNCTIONS for now.

This is a simple example of a SUB:
' subroutine demo
test1$="abcdefghijg"
test2$="abcde"
print test1$;" "; test2$
samelen test1$, test2$
print test1$;" "; test2$

end

Sub samelen (a$, b$) ' pads the shorter variable with leading zeros
local dif, z$
dif=Abs(Len( a$ )-Len( b$ ))
z$=String$(dif,"0")
If Len( a$ ) < Len( b$ ) Then
a$ = z$+a$
Else
b$ = z$+b$
EndIf
End Sub


Showing us the code you are having problems with will help...

Jim


Many many thanks Jim.

I'll study that and learn a lot !

Greatly appreciated !



Tim
 
Tim036
Newbie

Joined: 25/11/2014
Location: United Kingdom
Posts: 17
Posted: 09:20am 23 Dec 2014
Copy link to clipboard 
Print this post

I modified it to deal with numbers, as strings are interesting but not often used by me.

And came up with this inelegant but working first stab at the task:-

'subroutine demo
test1=3
test2=5
Print test1;" "; test2
samelen test1, test2
Print test1;" "; test2

End

Sub samelen (a, b)

If a=3 Then ' change to test this subroutine
b=b+a+10
Else
b=b+a-10
EndIf

End Sub

Thank you very much Jim for getting me going, on what was a big hurdle for me (probably trivial for most students)

: )))

Tim
 
Print this page


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

© JAQ Software 2024