Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:35 29 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 : MicroMite Beta 17

     Page 1 of 2    
Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 09:00pm 07 Apr 2014
Copy link to clipboard 
Print this post

Geoff,
I think you were away camping when we found the FUNCTION problem.

Subs and Functions cannot be declared on the first line of a program.

Remove the first line of this code (the comment) and it will give an error "Unknown command".
Put the Function declaration on the first line and you will also get an error.
'
sub test x
y = x*x
end sub

function square(x)
square = x*x
end function

print square(3)
test 3
print y

I am not sure if there are any other first line problems.
VK7JH
MMedit   MMBasic Help
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 03:01pm 08 Apr 2014
Copy link to clipboard 
Print this post

Aahh, not good. Thanks, I will dig into it.

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

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 11:29pm 08 Apr 2014
Copy link to clipboard 
Print this post

Thanks everyone, I have found the bug and fixed it in Beta 18 which on its way now.

Please let me know if you find anything else as I do need to close the beta program in the next few days.

Thanks again for everyone's help,
Geoff
Geoff Graham - http://geoffg.net
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 926
Posted: 01:42am 09 Apr 2014
Copy link to clipboard 
Print this post

Geoff, do you get any sleep?Edited by Graeme Meager 2014-04-10
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 03:05am 09 Apr 2014
Copy link to clipboard 
Print this post

Yes, but I have been spending far too much time on this. It is now coming up to five months!!
Geoff Graham - http://geoffg.net
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 03:41am 09 Apr 2014
Copy link to clipboard 
Print this post

But you've created something big!!!
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 926
Posted: 11:31am 09 Apr 2014
Copy link to clipboard 
Print this post

  Geoffg said   Yes, but I have been spending far too much time on this. It is now coming up to five months!!

And I guess I am not the only one who is very grateful
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 01:24pm 09 Apr 2014
Copy link to clipboard 
Print this post

Geoff,

Thank you for the fantastic effort.

I am very sorry to be suggesting additions so late in your efforts to settle development before release and had thought to not do so until after release. But I now think that due to difficulties for those without a PicKit-3 to update it should be considered now.

Although you have now included in the Manual the possible need for a hardware start up delay. A possible alternate solution that would satisfy all users is to add something like: -

Option Start nbr.

Where nbr would be milliseconds delay possibly added to the minimal delay within the current MicroMite. This method would satisfy uses requiring no delay and those for whom it would be useful. Such an approach would enable all to use the simple application circuit detailed on page 8 of the Manual and turn what is now an inconvenience into a feature. Those who are supplying development boards without a hardware delay will be certain that their products will present a clean start in all circumstances.

Is there room to add this feature? This possible solution has only just firmed in my conscience.

Keith W.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 07:45pm 09 Apr 2014
Copy link to clipboard 
Print this post

That sounds like a good idea Keith but it will have to wait for the next release after 4.5 (final). It is too close to the release date for me to risk adding more functionality. This is because most bugs are caused by adding a new feature which results an unexpected side effect somewhere else.

GeoffEdited by Geoffg 2014-04-11
Geoff Graham - http://geoffg.net
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2817
Posted: 09:55pm 09 Apr 2014
Copy link to clipboard 
Print this post


I now also support Keith's idea for a 'start up delay' option - and a great suggestion too as to how to implement this feature.

However as Geoff says, there must be absolutely zero additional risk to his software now that it is about to be launched to the public. We should therefore accept that we will have to wait for this feature to be implemented in a future release; thats assuming Geoff is ok to implement it!

I am about to launch a website dedicated to the MicroMite and have considered adding a page for people to add their own suggestions/ideas/'demands'/etc for the MicroMite. Then all these 'recommendations' will be in one place for us all to refer to, comment against, and possibly vote for. Please feedback your thoughts as to if you think this is a good idea or not to help me consider if such a page is worth implementing . . .





For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Lou

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 10:22pm 09 Apr 2014
Copy link to clipboard 
Print this post

Keith, Geoff, Wiz,

Wouldn't a simple 'pause xxxx' as the first line in the code work for a startup delay ??

Lou
Microcontrollers - the other white meat
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 12:04am 10 Apr 2014
Copy link to clipboard 
Print this post

Hi Lou,

A delay after the MicroMite starts executing program code is too late. The symptom is that the MicroMites startup greeting is corrupted on the PC/Terminal due to the Console port communication hardware not being ready quickly enough at power-up; otherwise the MicroMite starts OK. The problem to be overcome may only be cosmetic. My concern is that it will cause concern particularly to a new user who does not realize what is happening and who may gain the impression that all is not well.

A corrupted greeting does not look professional.

Keith W.
 
Lou

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 12:18am 10 Apr 2014
Copy link to clipboard 
Print this post

Keith,

OK, I got it - you need it to delay even before the boot up message to the console.

I was thinking delay before it started manipulating port lines, etc. Your 'Option Start nbr' would be perfect for all users.

Lou
Microcontrollers - the other white meat
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 02:42am 10 Apr 2014
Copy link to clipboard 
Print this post

capacitor/resistor on the reset pin will do the trick.

really, if someone knows how to change an option setting to alter the startup delay, they will probably also be able to type in "watchdog 1" to see the startup message.


i have a question for geoff: how far removed is the DISTANCE function from a general-purpose function that generates a start pulse then times the delay from the end of the start pulse to a second event happening?

for instance:

duration = ELAPSED (trigger, response, length, timeout)

where trigger is a pin that is initially pulsed for length microseconds,
response is a pin to monitored for a state change after the trigger pulse ends,
timeout is a maximum time (in microseconds) after which duration is returned as -1.
if timeout is not exceeded, then duration returns a value in microseconds.

i'm thinking of this as something that may be very useful in the next version of micromite basic. one thing that is currently lacking is the ability to easily do microsecond level timing of events. at the moment, the closest is using an external gate on the RTC's 32kHz signal fed into a counting pin. but that is complicated (plus also requires the RTC to be there).


rob :-)Edited by robert.rozee 2014-04-11
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 03:40am 10 Apr 2014
Copy link to clipboard 
Print this post

Another way of high speed timing is to generate a high speed signal using PWM and gate that into a counting input using a NAND gate or similar. But I agree, it would be much better is there was an elegant solution in firmware.

The trouble is that MMBasic is not suited to high speed work and secondly I have not come up with a succinct specification for what is needed to cover most requirements.

But, anyway, it will have to wait for later (as you acknowledged).

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

Guru

Joined: 11/04/2012
Location: Australia
Posts: 926
Posted: 11:49pm 12 Apr 2014
Copy link to clipboard 
Print this post

Just to prove that there isn't a bug can someone try the DS18B20() function with clock speeds of 5 and 10 Mhz (cpu 5 or cpu 10).My program seems to freeze at these clock freqs and it may be something else that is causing it.

Thanks in advance.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2817
Posted: 11:54pm 12 Apr 2014
Copy link to clipboard 
Print this post

I am about to go out for the day. If nobody else has done this in the next 24hrs then I will do this test then.

Which PIC are you using exactly?

Can ANYBODY else do this test please ? . . . .

For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 926
Posted: 12:03am 13 Apr 2014
Copy link to clipboard 
Print this post

  WhiteWizzard said   I am about to go out for the day. If nobody else has done this in the next 24hrs then I will do this test then.

Which PIC are you using exactly?

Can ANYBODY else do this test please ? . . . .


I am using the 28 pin PICs
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 12:52am 13 Apr 2014
Copy link to clipboard 
Print this post

I can confirm that at 5 and 10 MHz the program freezes, waiting I guess for an answer from the DS18B20.
OK at 20 MHz.
Using a 28 pin MX150F128B with version Beta 18

Keith W.Edited by Keith W. 2014-04-14
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2817
Posted: 09:03am 13 Apr 2014
Copy link to clipboard 
Print this post

Keith, Graeme:
Are you using the 40MHz or 50MHz versions of the 28pin PICs??

Graeme: The 150 or 250??

Thanks . . .

PS: I will look at this on analyser when I get home to see if I can work out what is happening.



For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
     Page 1 of 2    
Print this page
© JAQ Software 2024