Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:56 02 Aug 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 : Apparent Bug in BASIC 5.05.03

     Page 2 of 2    
Author Message
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 11:07am 31 Jul 2020
Copy link to clipboard 
Print this post

  TassyJim said  goc30,
The command to change program location is:
OPTION RAM to store the program in RAM. This reserves 512k of the RAM for your program which is why the RAM available for variables etc is less when you have OPTION RAM set.

To change back to flash storage, use OPTION FLASH (not OPTION RAM OFF)
When you use OPTION FLASH, you can specify the starting flash page. This is to allow you to change flash pages if you ever wear the flash out.
Using FLASH gives you back the extra 512k of ram for variables etc.


Jim


I know that for disable "option ram" you must use "option flash". That is not THE problem.
Problem is that in user manual it is said that "option ram" load program in ram not only data, but in fact, all program is in flash, not in RAM.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 11:33am 31 Jul 2020
Copy link to clipboard 
Print this post

  Quote  Problem is that in user manual it is said that "option ram" load program in ram not only data, but in fact, all program is in flash, not in RAM.


No it isn't. It is just the text in the memory command that is misleading - I'll fix that in the next beta. Use MM.INFO(PROGRAM) to see where the program is stored
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 07:38am 01 Aug 2020
Copy link to clipboard 
Print this post

  matherp said  

No it isn't. It is just the text in the memory command that is misleading - I'll fix that in the next beta. Use MM.INFO(PROGRAM) to see where the program is stored


I am sorry but I have only documents to know how to use functions.

Have-you seen my post in "CMM2 next step"??
my wish

I have an other problem. it is with "ARC" function
some times my program stop with an error (Error radial)

I give you my program


Dim t%, x%, y%, r%, red%, green%, blue%, c%, b%
Dim x1%,y1%,la%
Dim x2%,y2%
dim timtot as float
dim integer maxx
dim integer maxy
Dim vtim As float
dim INTEGER elx(61), ely(61), elxd(61), elyd(61) , elxe(61), elye(61)
dim integer elc, elf, elxp, elyp,eli2,eli1
dim float ela, els, ele, sine, cosine,el1
dim i as integer
dim j as integer
dim n as integer
dim txt1$ as string
dim txt2$ as string
Dim nbx%
maxx=MM.VRES-1
maxy=mm.hres-1
nbx%=300
timtot=0
'---- test 26 : draw x arcs color and 1pixel width
 CLS RGB(black)
 txt1$="Arcs function (1 pixel) test in"
 writtitle(txt1$)
 
 Timer=0
 For i%=1 To nbx%
   x%=Rnd()*maxx
   y%=Rnd()*maxy
   x1%=Rnd()*maxx
   y1%=Rnd()*maxy
   c%=Rnd()*&hffffff
   els=rnd()*360 'random size
   ela=rnd()* 360 'random angle
   Arc x%,y%,x1%,,els,ela,c%
 Next i%
 vtim=Timer/1000: timtot=timtot+vtim
 writresult(vtim)

'---- test 27 : draw x arcs color and rnd pixel width

 CLS RGB(black)
 txt1$="Arcs function (x pixels) test in"
 writtitle(txt1$)
 
 Timer=0
 For i%=1 To nbx%
   x%=Rnd()*maxx
   y%=Rnd()*maxy
   x1%=Rnd()*maxx
   y1%=x1%+(Rnd()*30)
   if y1%=x1% then y1%=x1%+1
   c%=Rnd()*&hffffff
   els=rnd()* 360 'random start arc
   ela=rnd()* 360 'random end arc
   'print els, ela
   'if els>ela then el1=ela:ela=els:els=el1
   Arc x%,y%,x1%,y1%,els,ela,c%
 Next i%
 vtim=Timer/1000: timtot=timtot+vtim
 writresult(vtim)
end

sub writtitle(tx as string)
local tx1$
   tx1$="Test "+str$(n)+" "+tx+"                                              "
   tx1$=left$(tx1$,50)
   Print tx1$;
end sub

sub writresult(t1 as float)
     Print Str$(t1,2,3,"0")+" Seconds"
     'Pause(ttp)
end sub


Edited 2020-08-01 17:46 by goc30
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:11am 01 Aug 2020
Copy link to clipboard 
Print this post

Try adding this line before each ARC command
if abs(els-ela) < 1 then els = ela+1

The starting and ending arcs are too close to each other.
I am not sure what the minimum is but a value of 1 seems to work reliably.

Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 08:15am 01 Aug 2020
Copy link to clipboard 
Print this post

  Quote  I have an other problem. it is with "ARC" function
some times my program stop with an error (Error radial)


This happens when the integer value of the radials is the same i.e. it is not an arc. The error is correct your program should check for the angles being the same before making the ARC call

  Quote  Have-you seen my post in "CMM2 next step"??
my wish


Sorry but I can't do anything about this. The battery backed area of RAM I use for options is completely full
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 08:23am 01 Aug 2020
Copy link to clipboard 
Print this post

  matherp said  
This happens when the integer value of the radials is the same i.e. it is not an arc. The error is correct your program should check for the angles being the same before making the ARC call



in first time I have think that your response is good, but if I print values they give for exemple 340,126 and 340.855. values are float type, I think that is not equal, but maybe you work only with integer value

  matherp said  
Sorry but I can't do anything about this. The battery backed area of RAM I use for options is completely full


you don't work with bits for "on/off" parametres  ?
Edited 2020-08-01 18:26 by goc30
 
     Page 2 of 2    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025