Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:05 26 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 : Maximite test ver 2.4A - with EDITING

     Page 1 of 2    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 04:24am 26 Jun 2011
Copy link to clipboard 
Print this post

On my travels I have been adding some often requested features to the Maximite firmware (it beats doing crosswords while hiding from the mosquitoes at night).

The new version can be downloaded from:
http://geoffg.net/Downloads/Maximite/Maximite_Update_V2.4A.z ip

This is a test version so it might include a newly introduced bug or two.

New features are:
- Fixed a bug where the MOD operator did not throw an error on an attempted divide by zero.
- Added the EDIT command to allow convenient editing of program lines held in memory.
- Added the OPTION PROMPT command to enable customisation of the command prompt.
- Added the function CWD$ which returns the current working directory on the SD card.
- Added PEEK/POKE commands for manipulating memory within the PIC32 processor.
- Added a preset read only variable MM.VER which returns the version number of the firmware.

The syntax of the edit command is:
EDIT line-number

If no line number is used this command will edit the previous entry typed at the command prompt. On entering the edit mode the line will be displayed and the cursor placed at the beginning of the line.

The editing commands are:
Space - Step the cursor one character to the right
Backspace - Step the cursor one character to the left
D - Delete the character over the cursor
nnD - Delete nn characters at the cursor and to the right
X - Jump to the end of the line and enter insert mode
I - Enter insert mode. All keystrokes will be inserted before the cursor. Use escape to exit insert mode.

Use Enter (or Return) to finish editing (even in insert mode). When Enter is pressed the line is added to the program just as if it had been typed in at the command prompt. If the line number had been changed a new (edited) copy of the line will be added to memory, if it is unchanged the line will replace 'line-number'. The maximum line length that can be edited is 79 chars in VGA mode and 49 chars in composite mode.

This is a temporary facility. In the future I would like to use the full keyboard keys (insert, delete, arrows, etc) for editing.

The prompt option was very easy to do and consists of:
OPTION PROMPT string$

Sets the command prompt to the contents of 'string$' (which can also be an expression which is evaluated when the prompt is printed).

For example:
OPTION PROMPT "Ok "
or OPTION PROMPT TIME$ + ": "
or OPTION PROMPT CWD$ + ": "

Maximum length of the prompt string is 48 characters. The prompt is reset to the default ("> ") on power up but you can automatically set it by saving the following example program as "AUTORUN.BAS" on the SD card.

10 OPTION PROMPT "My prompt: "
20 NEW

The new function CWD$ simply returns the current working directory as a string.

The syntax of the poke command is:
POKE hiword, loword, val

Will set a byte within the PIC32 virtual memory space to 'val'.
'hiword' is the top 16 bits of the address while 'loword' is the bottom 16 bits.

This command is for expert users only. Via the Bus Matrix the PIC32 maps all control registers, flash (program) memory and volatile (RAM) memory into a single virtual address space (so there is no need for INP or OUT commands). The PIC32MX5XX/6XX/7XX Family Data Sheet lists the details of this address space while the source code will provide the symbolic names used in the firmware and the Maximite.map file (produced after a successful compile) will list the addresses of these symbols. These addresses could easily change with each version of the firmware so programs should use the predefined variable MM.VER to determine the currently running version.

For anyone who wants to play with the video memory - in this version it can be found at hiword = &Ha000, loword = &Hd250.

WARNING: If you use this facility access an invalid memory address the MIPS CPU will throw an exception which causes the processor to reset - with the resulting loss of the program and data in memory. To see this effect try POKE 0,0,0 (it won't hurt your Maximite!)

The PEEK function is:
PEEK( hiword, loword )

Will return a byte within the PIC32 virtual memory space. See the POKE command for notes and warnings related to memory access.

The read only variable MM.VER returns the version number of the firmware in the form aa.bbcc where aa is the major version number, bb is the minor version number and cc is the revision number (normally zero but A = 01, B = 02, etc).

Please let me know if you find any bugs or issues.

Thanks,
Geoff
Geoff Graham - http://geoffg.net
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 04:28am 26 Jun 2011
Copy link to clipboard 
Print this post

Thanks Geoff, you need to hide from those mosquitoes. I hear they breed them big up there.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 06:59am 26 Jun 2011
Copy link to clipboard 
Print this post

Thank you very much Geoff.

Just so it makes it look like I am organized, if someone can verify the features that Geoff has added as working fine, and I have them in the wish list at:

http://www.themaximitecomputer.com/wish-list-priority-level- poll/

Then please let me know the wish list number, and I will remove the wish from the poll, and log your username against the wish in my highly organized wish list remover procedures.

I should have worked for the government. Well, I did a few times actually.

But then, who didn't.

Cheers Don... Edited by donmck 2011-06-27
https://www.dontronics.com
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 07:05am 26 Jun 2011
Copy link to clipboard 
Print this post

Don, edit works as advertised
Option Prompt works too.

Haven't had a chance to check anything else out.

StuartEdited by stuarts 2011-06-27
Time is nature's way of keeping everything from happening all at once.
 
sparkey

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 819
Posted: 07:28am 26 Jun 2011
Copy link to clipboard 
Print this post

i know this prolly is not the right place but is there any way that the function keys can be controled to act as/files/run/list/ and make them user defind...
thank you......
technicians do it with least resistance
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 07:39am 26 Jun 2011
Copy link to clipboard 
Print this post

  sparkey said   i know this prolly is not the right place but is there any way that the function keys can be controled to act as/files/run/list/ and make them user defind...
thank you......


No, but it would make a good future feature.

Geoff
Geoff Graham - http://geoffg.net
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 07:40am 26 Jun 2011
Copy link to clipboard 
Print this post

  sparkey said   i know this prolly is not the right place but is there any way that the function keys can be controled to act as/files/run/list/ and make them user defind...
thank you......


I was thinking of writing a set of AutoHotKey macros for certain functions during the terminal operations, but it would be low on my priority list.

Same sort of thing for the F keys would be nice.

Cheers Don...
https://www.dontronics.com
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 07:45am 26 Jun 2011
Copy link to clipboard 
Print this post

  stuarts said   Don, edit works as advertised
Option Prompt works too.

Haven't had a chance to check anything else out.

Stuart


Thanks Stuart, I'll cross it off then.

http://www.themaximitecomputer.com/wish-list-priority-level- poll/

Cheers Don...
https://www.dontronics.com
 
VK6MRG

Guru

Joined: 08/06/2011
Location: Australia
Posts: 347
Posted: 08:10am 26 Jun 2011
Copy link to clipboard 
Print this post

Option prompt works perfectly.
Edit works very well, no problems
The poke error came up as described, and as I’m just beginning to get used to Basic programming again after 25 years not using Basic I’ll wait until I have progressed up a few levels of Basic programming greatness before trying PEEK and POKE
Edited by VK6MRG 2011-06-27
Its easier to ask forgiveness than to seek permission!

............VK6MRG.............VK3MGR............
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 08:20am 26 Jun 2011
Copy link to clipboard 
Print this post

  VK6MRG said   Option prompt works perfectly.
Edit works very well, no problems
The poke error came up as described, and as I’m just beginning to get used to Basic programming again after 25 years not using Basic I’ll wait until I have progressed up a few levels of Basic programming greatness before trying PEEK and POKE



OK, so I will get rid of wish 3 then.

http://www.themaximitecomputer.com/wish-list-priority-level- poll/

"The poke error came up as described,"
Do I need to do anything there?

I have been spending my time on hardware I/O, not on programming. I hope that I can go in that direction as soon as I get the first prototype board settled.

Funny, I am having trouble explaining it all to close associates, so I hope it works out in the end. I see it as simple, but one can convince oneself very easily.

All about board stacking, and addressing.

Hey Don, is this good?, I ask myself. Is Don is good man, yeh!

Cheers Don...




https://www.dontronics.com
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 10:36am 26 Jun 2011
Copy link to clipboard 
Print this post

The EDITOR is a God send!!!!

Whoo Hoo! Poke and Peek. Any way to execute a M/L program?

I'd imagine this may stuff up the Video Generation routines.

Time I learned PIC32 assembly language!

You're not a Geek unless you know assembly!

And if you know the machine code mnemonics off by heart, you're a Geek with a hairy chest!!
 
sparkey

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 819
Posted: 10:58am 26 Jun 2011
Copy link to clipboard 
Print this post

geoff is there any other program that can load the 4.2 hex file even if it means running in dos mode ...i dont mind ialso have dos usb drivers on a boot cd that
i have made up usb 2.0 as well ...as i dont have the dot net system files sorry im behind the times i guess ...thanks ...
technicians do it with least resistance
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 11:03am 26 Jun 2011
Copy link to clipboard 
Print this post

Learning MIPS assembly language would not be easy. The MIPS instruction set was the first to be designed for optimising compilers and gets a lot of its speed by depending on the compiler to do tricks that optimise the CPU's operation.

For example, the CPU will always execute the instruction after a branch test THEN execute the branch. An optimising compiler will search both sides of the branch to find an instruction that is common to both and will place it after the test.

If you are interested, here is a summary of the MIPS instruction set:
www.mips.com/media/files/MD00565-2B-MIPS32-QRC-01.01.pdf

A better solution would be to figure out some way for compiled C language subroutines to be dynamically loaded. The PIC32 allows code to be executed from RAM so it should be doable but it would be a lot of work and probably only one or two people on the planet would want to use that feature. I still maintain that it is better to download the source, add your own functions and recompile... that has to be better than learning MIPS assembler or me figuring out how to load dynamic modules.

Geoff
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 11:06am 26 Jun 2011
Copy link to clipboard 
Print this post

  sparkey said   geoff is there any other program that can load the 4.2 hex file even if it means running in dos mode ...i dont mind ialso have dos usb drivers on a boot cd that
i have made up usb 2.0 as well ...as i dont have the dot net system files sorry im behind the times i guess ...thanks ...


No, the maximite firmware will only run on a PIC32 chip.
Geoff Graham - http://geoffg.net
 
sparkey

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 819
Posted: 11:14am 26 Jun 2011
Copy link to clipboard 
Print this post

no i meant that i cannot upgrade to four point two from 2point 1
only have xp ser pack three..it does not have the dot net files and i only run dial up thats y
technicians do it with least resistance
 
sparkey

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 819
Posted: 11:15am 26 Jun 2011
Copy link to clipboard 
Print this post

i have ran my boot disk with the maxi connected and the usb drivers find it....
technicians do it with least resistance
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 11:22am 26 Jun 2011
Copy link to clipboard 
Print this post

Sparkey, the problem I see is that bootloader.exe is a windows program and the effort to create a dos version wouldn't be worth it.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
sparkey

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 819
Posted: 11:41am 26 Jun 2011
Copy link to clipboard 
Print this post

thanks
technicians do it with least resistance
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 12:45pm 26 Jun 2011
Copy link to clipboard 
Print this post

  sparkey said   no i meant that i cannot upgrade to four point two from 2point 1
only have xp ser pack three..it does not have the dot net files and i only run dial up thats y

Do you know anyone with a broadband link who could download the .NET update files from Microsoft for you?
You might even be able to download them through the local library.
My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 01:12pm 26 Jun 2011
Copy link to clipboard 
Print this post

Sparkey, if you cant get to a library, I seem to remember that .net framework is about 30MB. even at dial up speeds, it shouldn't take much more than an hour to download. I remember downloading 400MB CD images on dialup when I had no other option. Do it now and you'll surely have it by tomorrow morning.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024