Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 04:48 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 10

     Page 1 of 4    
Author Message
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 06:49am 07 Mar 2014
Copy link to clipboard 
Print this post

Just loaded new Beta 10..

Till now no Bugs found.
Will test further Options this Weekend.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 03:36pm 07 Mar 2014
Copy link to clipboard 
Print this post

finally have real hardware working - what a hassle getting mplab to do the right things. by default it seems to keep host power turned off, and you need to go into 'advanced' mode to turn it on. as yet, i've not found a way to make this setting stick.

mplab is also not 'netbook aware' (under winXP at least). it opens a window that is more than 600 pixels high, and the only way i could view the status results was to continually select all with ctrl-A, paste into notepad, and read the text at the end.


anyways, as i have hinted at elsewhere, the mod operator in MMbasic returns incorrect results. X mod Y, where Y is a positive value, should always returns results between 0 and Y-1. it should _never_ return a negative result as far as i am aware.

the results i see are:

> ? (-1) mod 3
-1


i would expect the result to instead be 3. this is why my code solution for the rotary encoder (using the mod operator) always counted up!


rob :-)
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 03:43pm 07 Mar 2014
Copy link to clipboard 
Print this post

addendum, see:
http://en.wikipedia.org/wiki/Modulo_operation

it does seem that various languages may interpret negative values for X and Y different. my own experience (as outlined in the previous post) is with pascal. the question is, does MMbasic consider X mod Y as an integer operator, or working on reals?Edited by robert.rozee 2014-03-09
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 07:20pm 07 Mar 2014
Copy link to clipboard 
Print this post

Geoff,

Minor clarification for the manual.

Pin 20 (28pin) and Pin 7 (44pin) MicroMite connections the description says

47µF TANT CAPACITOR (+) TO GROUND I feel that is a bit confusing and maybe should be simply 47µF TANT CAPACITOR (+)

with maybe pin 19/6 labelled 47µF TANT CAPACITOR (-)/GROUND

Regards,

Mick

Edited by bigmik 2014-03-09
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6101
Posted: 07:59pm 07 Mar 2014
Copy link to clipboard 
Print this post

  robert.rozee said  
anyways, as i have hinted at elsewhere, the mod operator in MMbasic returns incorrect results. X mod Y, where Y is a positive value, should always returns results between 0 and Y-1. it should _never_ return a negative result as far as i am aware.

the results i see are:

> ? (-1) mod 3
-1


i would expect the result to instead be 3. this is why my code solution for the rotary encoder (using the mod operator) always counted up!


rob :-)


I program in Liberty Basic and PureBasic. Both give the same results as MMbasic.
It is a bit like INT, there is no one method used.

Jim
VK7JH
MMedit   MMBasic Help
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 01:20am 08 Mar 2014
Copy link to clipboard 
Print this post

  TassyJim said  I program in Liberty Basic and PureBasic. Both give the same results as MMbasic. It is a bit like INT, there is no one method used.

Jim


the original GWbasic also agrees with MMbasic, so i guess i must bite my tongue. although excel and python do produce the results i expected - from brython (http://www.brython.info/tests/console.html) i get the result:

Brython 2.0 [0] on Netscape 5.0 (Windows)
>>> (-1) % 4
3
>>>


the MOD operator can be persuaded to always return a 'clock arithmetic' result simply by adding a suitably large positive offset (that is a multiple of the divisor) to the dividend, so from a coding perspective it is easy to get around the problems with negative dividends.
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 10:35am 08 Mar 2014
Copy link to clipboard 
Print this post

@Geoff
One thing I really miss is the ability to press the up arrow
to recall the last typed command


Regards
Jman

 
Geoffg

Guru

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

Yes, I miss the command line editing also. I will see how much flash is left after all the features have been added/stabilised and see if it can be fitted back in.

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

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 10:00pm 08 Mar 2014
Copy link to clipboard 
Print this post

Geoff,

Testing beta 10 here with Zonker, no problems found so far.

Would it be feasible to add a complimentary output to one or both PWM channels ??
I have need for that feature. I am doing it now by feeding the PWM output into an interrupt both input pin, complementing the level and outputting that on another pin. Doing it that way there is a lot of jitter and increasing latency time as the freq goes up, and it overruns the interrupts around 500Hz. If possible that feature would be a great help to me. Zonker says to use an inverter but it would be nice to keep it on the uMite chip.

Thanks,

Lou
Microcontrollers - the other white meat
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:03am 09 Mar 2014
Copy link to clipboard 
Print this post

Lou there are five! PWM capable outputs.
I think it was introduced from beta 7.
Microblocks. Build with logic.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 831
Posted: 05:30am 09 Mar 2014
Copy link to clipboard 
Print this post

Yeah! And this five PWM outputs are working with independent duty cycle very well!!!

Frank
 
Lou

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 06:07am 09 Mar 2014
Copy link to clipboard 
Print this post

TZ, Frank,

I tried the five PWM's setup in two channels but they are all in phase. I need an output with a 50/50 duty cycle and an inverted output 180 degrees out of phase with a 50/50 duty cycle. Why do something in hardware with an inverter if it's (hopefully) easy to do in software. It might be easy to setup in a command like PWM 1, freq, 1A, 1B, 1X for the inverted output. Maybe even do it for both channels.

If it uses too much resources to do in software I can use an inverter but it doesn't hurt to ask. Only Geoff knows.

Thanks for the help guys,

Lou
Microcontrollers - the other white meat
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 06:41am 09 Mar 2014
Copy link to clipboard 
Print this post

just use a Transistor to invert it....
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 831
Posted: 07:37am 09 Mar 2014
Copy link to clipboard 
Print this post

Hi Lou,

PWM1 and PWM2 are totally independent but I don't know if they are in phase when you use the same frequency...
I think that using a inverter or a transistor (like Atmega8) recommended should be a possibility for you...

Frank
 
OA47

Guru

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

Should I find variations from the analog input readings and one wire port when I drop the clock speed? Or is my regulator varying slightly with less load?
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 12:11pm 09 Mar 2014
Copy link to clipboard 
Print this post

  Graeme Meager said   Should I find variations from the analog input readings and one wire port when I drop the clock speed? Or is my regulator varying slightly with less load?


A better way to do it is to take 10 or 20 readings then divide
by the same. Try this and post the result


Regards
Jman
 
OA47

Guru

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

Jman, the results are very consistent at any speed. It is that the one wire temperature goes from 28 deg @ 48Mhz and reads -2.93 @ 5Mhz. An analog voltage reading goes from 12V to 18v over the same freq change.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 05:15pm 09 Mar 2014
Copy link to clipboard 
Print this post

  Lou said  Would it be feasible to add a complimentary output to one or both PWM channels ??

No, sorry. The output compare (PWM) hardware in the PIC32 does not make that easy to do and it would add a heap of complications for something that could be solved with an inverter.

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

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 05:33pm 09 Mar 2014
Copy link to clipboard 
Print this post

Geoff,

Thanks for looking at it, an inverter it is.

Lou
Microcontrollers - the other white meat
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 01:03am 10 Mar 2014
Copy link to clipboard 
Print this post

against my better judgement, can i request a couple of features :-)

1. the means for an interrupt service routine to tell what action called it. in some applications, one isr may be able to service interrupts generated by (in particular) several different pins. as far as i can see, there is currently no way for the isr to tell what the source of the interrupt was. a simple solution would be to introduce a variable called MM.INTPIN that is set to the number of the pin that generates an interrupt, with perhaps the polarity of the signal on the pin indicated in the sign of MM.INTPIN (+ve = high, -ve = low, 0 = non-pin generated interrupt).

2. please, please, please add the following functions:
ASIN
ACOS
ATAN (as an alias for ATN).
for anyone wanting to do any trig functions this saves a load of messing around with trig identities.

rob :-)
 
     Page 1 of 4    
Print this page
© JAQ Software 2024