Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:30 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 : Beta Testers Wanted

     Page 21 of 26    
Author Message
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 10:00am 02 Feb 2014
Copy link to clipboard 
Print this post

In combination with i2c and simple print commands i got also some strange issues.

A simple Print "something" out of The i2c Operationen after i2stop and The interpreter throwd errors.

I cannot give more details, have to go to bed now.

 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 07:55pm 02 Feb 2014
Copy link to clipboard 
Print this post

  Grogster said  At the command prompt, type:

> n$="Hello World."
> ? n$
Hello World.
> edit

Now, exit the editor, and type ? n$ again - it's gone.


That is correct, the editor need as much RAM as it can get, so it clears all variables when it loads.

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

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9310
Posted: 09:11pm 02 Feb 2014
Copy link to clipboard 
Print this post

Understood. Thanks.
Smoke makes things work. When the smoke gets out, it stops!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 11:25pm 02 Feb 2014
Copy link to clipboard 
Print this post

Thanks everyone, a second bug found and squashed.

I am referring to the corrupted length for a string variable after an I2C operation.

It turned out to be a tricky fellow to find but once found it was an easy fix. Thanks very much to everyone for distilling the demonstration to a few lines of code. Getting that demo is 90% of the effort in tracking a curly one like this.

I had done a lot of testing of the I2C function but never found this one. It shows how hard it is to uncover the subtle bugs and how handy a second (or a third, etc) set of eyes are. Thanks again.

I have just received my 44 pin chips so I will solder them up tomorrow, give them a thorough test and get the next beta out (which will include the fix for this bug).

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

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 07:36am 03 Feb 2014
Copy link to clipboard 
Print this post


Hi,

this simple print "hallo"
throws an error.
Without this print, the program works.

I really dont know why, hope the bug is not in front of the Screen ;-)
If so, sorry!!!


'****************************************************
'** Fuer Schweitzer-RTC: RV-3029 *
'** Dezimal = (BCD \ 16 * 10 ) + (BCD MOD 16) *
'** BCD = (Dezimal \ 10 * 16 ) + (Dezimal MOD 10) *
'** www.timogru/1/bcd-in-dezimalwerte-umrechnen/ *
'** *
'** !!ACHTUNG BASIC DIVISION !! *
'** / ist Division 10 / 3 = 3.333333 *
'** \ ist Integer Division 10 \ 3 = 3 *
'** *
'****************************************************
Dim RTCbuff(6) ' Received data is stored here
I2C OPEN 100,100 ' Start up the I2C module
I2C WRITE &h56, 0, 1, &H08
I2C WRITE &h56, 0, 3,&B01111111,&B01111111,&B01111111
If MM.I2C <> 0 Then Error "RTC Typ RV-3029 not responding"
I2C Close
Pause 1000
I2C OPEN 100,100 ' Start up the I2C module
I2C WRITE &h56, 0, 1, 8 ' Request the time
If MM.I2C <> 0 Then Error "RTC Typ RV-3029 not responding"
I2C READ &h56, 0, 7, RTCbuff(0) ' Get the time as 7 bytes
I2C CLOSE ' Close the I2C function

seconds = rtcbuff(0) And &b00001111
zehnerseconds = rtcbuff(0) And &b01110000
zehnerseconds = (zehnerseconds \ 16) * 10 + zehnerseconds Mod 16
Print zehnerseconds + seconds

minutes= rtcbuff(1) And &b00001111
zehnerminutes = rtcbuff(1) And &b01110000
zehnerminutes = (zehnerminutes \ 16) * 10 + zehnerminutes Mod 16
Print zehnerminutes + minutes

Print "hallo"

hours = rtcbuff(2) And &b00001111
zehnerhours = rtcbuff(2) And &b00110000
zehnerhours = (zehnerhours \ 16) + zehnerhours Mod 16
Print zehnerhours + hours
'Print hours

days = rtcbuff(3)
Print rtcbuff(3)
Print days

weekdays = rtcbuff(4)
Print rtcbuff(4)
Print weekdays

month = rtcbuff(5)
Print rtcbuff(5)
Print month

years = rtcbuff(6)
Print rtcbuff(6)
Print years

' Extract the time from the data saved into RTCbuff()
bcdtemp = RTCBuff(0) And &H7F ' Get just the bits that we want
sec$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(1) And &H7F
min$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(2) And &H3f
hours$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(3) And &H3f
day$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(5) And &h1F
month$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = rtcbuff(6)
year$ = Str$((bcdtemp \ 16) * 10 + (bcdtemp Mod 16) + 2000)
t$ = hours$+":"+min$+":"+sec$
D$ = day$+"/"+month$+"/"+year$
' display the result
Print "Time is "; T$; " Date is "; D$


ERROR:::


51
9
hallo
0
0
0
0
0
0
0
0
0
[59] bcdtemp = RTCBuff(0) And &H7F ' Get just the bits that we want
Error: Number too large
>
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 09:17am 03 Feb 2014
Copy link to clipboard 
Print this post

Hi ,

rem the print hallo but let it in ( no delete)
make a second print hallo

what you get ?

second test

in the start declare a string with "Hallo "

later print the string
same error ?

if yes the i2c routine corrupt the string , geoff have a solution and come with a new beta
Edited by plasma 2014-02-04
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 10:53pm 03 Feb 2014
Copy link to clipboard 
Print this post

Latest Beta firmware running and looking good (so far). I'll have to retrain myself with the altered function keys or tape key reminder a bit like a music kb with the notes above the keys.
David M.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 11:16pm 03 Feb 2014
Copy link to clipboard 
Print this post

Sorry about the change in the function keys - I should have mentioned that. I had a few requests to make them more in line with the editor (eg, F2 does the same thing).

Geoff
Geoff Graham - http://geoffg.net
 
WhiteWizzard
Guru

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

Geoffg (3rd Feb)
  Quote  I have just received my 44 pin chips so I will solder them up tomorrow, give them a thorough test and get the next beta out


MOBI (4th Feb)
  Quote  Latest Beta firmware running and looking good (so far)


Have I missed the release of the latest Beta?

Please advise when expected to be released (if not already!).

Also are there going to be separate firmware for 44pin and 28pin PICs. If so when to be released?

Thanks . . .
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 12:59am 04 Feb 2014
Copy link to clipboard 
Print this post

Check your email. If it is not there send me an email and I will resend
Geoff Graham - http://geoffg.net
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 831
Posted: 01:27am 04 Feb 2014
Copy link to clipboard 
Print this post

Hi Geoff,

thanks a lot for your new Revision!

Your new chapter "Flashing a LED, page 10" is very useful for beginners but your resistor seems with 82 ohms to small to me.
You wrote on page 23 that the typical current on any I/O pin should be max. 10 mA.
There is a current of approx. 17mA with a resistor of 82 ohms (3.3V-1.9V)/82R.
I think the resistor should be between 680 and 150 ohm...

Frank
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 02:09am 04 Feb 2014
Copy link to clipboard 
Print this post

No, if you test it in an actual circuit you will find that the current is about 10mA. You did not allow for the voltage drop inside the Micromite.
Geoff Graham - http://geoffg.net
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 06:15am 04 Feb 2014
Copy link to clipboard 
Print this post

Geoff, with your new Firmware Micromite MMBasic Ver 4.5 Beta 4( thanks for your great Job!!), this error has gone on my 28 PIN PIC!!!




  atmega8 said  
Hi,

this simple print "hallo"
throws an error.
Without this print, the program works.

I really dont know why, hope the bug is not in front of the Screen ;-)
If so, sorry!!!


'****************************************************
'** Fuer Schweitzer-RTC: RV-3029 *
'** Dezimal = (BCD \ 16 * 10 ) + (BCD MOD 16) *
'** BCD = (Dezimal \ 10 * 16 ) + (Dezimal MOD 10) *
'** www.timogru/1/bcd-in-dezimalwerte-umrechnen/ *
'** *
'** !!ACHTUNG BASIC DIVISION !! *
'** / ist Division 10 / 3 = 3.333333 *
'** \ ist Integer Division 10 \ 3 = 3 *
'** *
'****************************************************
Dim RTCbuff(6) ' Received data is stored here
I2C OPEN 100,100 ' Start up the I2C module
I2C WRITE &h56, 0, 1, &H08
I2C WRITE &h56, 0, 3,&B01111111,&B01111111,&B01111111
If MM.I2C <> 0 Then Error "RTC Typ RV-3029 not responding"
I2C Close
Pause 1000
I2C OPEN 100,100 ' Start up the I2C module
I2C WRITE &h56, 0, 1, 8 ' Request the time
If MM.I2C <> 0 Then Error "RTC Typ RV-3029 not responding"
I2C READ &h56, 0, 7, RTCbuff(0) ' Get the time as 7 bytes
I2C CLOSE ' Close the I2C function

seconds = rtcbuff(0) And &b00001111
zehnerseconds = rtcbuff(0) And &b01110000
zehnerseconds = (zehnerseconds \ 16) * 10 + zehnerseconds Mod 16
Print zehnerseconds + seconds

minutes= rtcbuff(1) And &b00001111
zehnerminutes = rtcbuff(1) And &b01110000
zehnerminutes = (zehnerminutes \ 16) * 10 + zehnerminutes Mod 16
Print zehnerminutes + minutes

Print "hallo"

hours = rtcbuff(2) And &b00001111
zehnerhours = rtcbuff(2) And &b00110000
zehnerhours = (zehnerhours \ 16) + zehnerhours Mod 16
Print zehnerhours + hours
'Print hours

days = rtcbuff(3)
Print rtcbuff(3)
Print days

weekdays = rtcbuff(4)
Print rtcbuff(4)
Print weekdays

month = rtcbuff(5)
Print rtcbuff(5)
Print month

years = rtcbuff(6)
Print rtcbuff(6)
Print years

' Extract the time from the data saved into RTCbuff()
bcdtemp = RTCBuff(0) And &H7F ' Get just the bits that we want
sec$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(1) And &H7F
min$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(2) And &H3f
hours$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(3) And &H3f
day$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = RTCBuff(5) And &h1F
month$ = Str$((bcdtemp \ 16) * 10 + bcdtemp Mod 16)
bcdtemp = rtcbuff(6)
year$ = Str$((bcdtemp \ 16) * 10 + (bcdtemp Mod 16) + 2000)
t$ = hours$+":"+min$+":"+sec$
D$ = day$+"/"+month$+"/"+year$
' display the result
Print "Time is "; T$; " Date is "; D$


ERROR:::


51
9
hallo
0
0
0
0
0
0
0
0
0
[59] bcdtemp = RTCBuff(0) And &H7F ' Get just the bits that we want
Error: Number too large
>
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 06:20am 04 Feb 2014
Copy link to clipboard 
Print this post

But i have Problems with the editor now.
If i scroll down in Tera Term edit mode (38400 Default Baudrate), i can not longer edit.
Scrolling down re´freshes only the last line and it is impossible to position the cursor to the last line now.
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 07:02am 04 Feb 2014
Copy link to clipboard 
Print this post

same Problems with different Baudrate......,




  atmega8 said   But i have Problems with the editor now.
If i scroll down in Tera Term edit mode (38400 Default Baudrate), i can not longer edit.
Scrolling down re´freshes only the last line and it is impossible to position the cursor to the last line now.
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 10:07am 04 Feb 2014
Copy link to clipboard 
Print this post

checked for escape sequences or any other, but the ASCII Text is really plain text.
Also tried wit xmodem and autosave.
Same result.

Sorry geoff Edited by atmega8 2014-02-05
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 01:02pm 04 Feb 2014
Copy link to clipboard 
Print this post

You need to set TeraTerm's terminal to the same number of lines as the MicroMite.
The MicroMite defaults to 24 lines but you can change that in the latest beta.

With the correct settings, everything seems to work OK for me.

I also have no problems with AUTOSAVE and pasting code into TeraTerm.
I have a 10 ms line delay set in TeraTerm/Paste but I expect that that is not needed.

Haven't tried Xmodem yet.

Jim
VK7JH
MMedit   MMBasic Help
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 06:57pm 04 Feb 2014
Copy link to clipboard 
Print this post

Hi atmega8, the latest beta works fine in the editor. Also, XModem works fine. You must have something wrong at your end.

For everyone else, I have found two bugs in the latest beta:
- the length qualifier for a string array in the DIM statement causes an error
- OPEN SPI in the 44 pin chip version does not work

Geoff
Geoff Graham - http://geoffg.net
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 07:32pm 04 Feb 2014
Copy link to clipboard 
Print this post

  jim said  
I also have no problems with AUTOSAVE and pasting code into TeraTerm.
I have a 10 ms line delay set in TeraTerm/Paste but I expect that that is not needed.


I also have the line delay etc set to 0 and xmodem and autosave work fine here.
David M.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9310
Posted: 08:51pm 04 Feb 2014
Copy link to clipboard 
Print this post

  Geoffg said  For everyone else, I have found two bugs in the latest beta:
- the length qualifier for a string array in the DIM statement causes an error

Geoff


I was using DIM n$(1) LENGTH 20 a couple of pages back, and the MM did not seem to throw a wobbly.

What kind of error?
Smoke makes things work. When the smoke gets out, it stops!
 
     Page 21 of 26    
Print this page
© JAQ Software 2024