Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:00 08 Jul 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 : Armmite L4 battery miser, first beta

     Page 6 of 8    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10222
Posted: 10:01am 24 Nov 2018
Copy link to clipboard 
Print this post

  Quote  it still gives me a full black screen between the one second updates if FULLREFRESHINTERVAL is left at 1.


This is the way they work I'm afraid. The response to partial updates seems to be screen specific. Remember these display were designed for applications like supermarket shelves where they updated very infrequently. For an application like a temperature display where the updates are, say, every 5 minutes the flashing display shouldn't be an issue. They certainly aren't suitable for anything remotely real-time
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 982
Posted: 10:07am 24 Nov 2018
Copy link to clipboard 
Print this post

Thanks for the info Peter, I was under the misconception that I should have been able to get the display to update a clock as per your Youtube video.

I will see if I can test the SetTick issue previously described.

Ran TassyJims code for SetTick and it seems to work ok.

Regards
OA47Edited by OA47 2018-11-25
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 12:06pm 24 Nov 2018
Copy link to clipboard 
Print this post

Hi matherp

Thanks for your job... very beautiful STM32L4.
Can I have the list of all cpu freq for STM32L4/H7. , I'm modifying Micromite console to set by software all possible frequencies.

Thanks
Antonio
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10222
Posted: 12:49pm 24 Nov 2018
Copy link to clipboard 
Print this post

  Quote  Can I have the list of all cpu freq for STM32L4/H7


H7 fixed 400MHz
L4 2,4,8,16,24,32,48,80
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 03:44pm 24 Nov 2018
Copy link to clipboard 
Print this post

Thanks matherp
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 12:51am 25 Nov 2018
Copy link to clipboard 
Print this post

Strange things happening with PAUSE

I decided to experiment with setting the RTC drift.

  Quote   ' armite clock test
OPTION LIST
timeout
t$=
TIME$
stalltime = (
60 - VAL(RIGHT$(t$,2)))*1000
PRINT stalltime
'pause stalltime
SETTICK 60000, timeout

timeout
DO
LOOP

SUB timeout
PRINT " ";TIME$;" ";DATE$
END SUB


This prints the time once a minute and I have MMedit set to time stamp each line.
  Quote  [08:55:01]> RUN
[08:55:03]OPTION LCDPANEL GDEH029A1, LANDSCAPE, 15, 21, 14, 22
[08:55:03] 08:55:03 25-11-2018
[08:55:03] 08:55:03 25-11-2018
[08:56:03] 08:56:03 25-11-2018
[08:57:03] 08:57:03 25-11-2018
[08:58:03] 08:58:03 25-11-2018
[08:59:03] 08:59:03 25-11-2018
[09:00:03] 09:00:03 25-11-2018
[09:01:03] 09:01:03 25-11-2018
[09:02:03] 09:02:03 25-11-2018
[09:03:03] 09:03:03 25-11-2018
[09:04:03] 09:04:03 25-11-2018
[09:05:03] 09:05:03 25-11-2018
[09:06:03] 09:06:03 25-11-2018
[09:07:03] 09:07:03 25-11-2018
[09:08:03] 09:08:03 25-11-2018
[09:09:03] 09:09:03 25-11-2018
[09:10:03] 09:10:03 25-11-2018
[09:11:03] 09:11:03 25-11-2018
[09:12:03] 09:12:03 25-11-2018
[09:13:03] 09:13:03 25-11-2018
[09:14:03] 09:14:02 25-11-2018
[09:15:03] 09:15:02 25-11-2018
[09:16:03] 09:16:02 25-11-2018


Everything looks goods but then I decided to PAUSE the printouts until the seconds were zero.
Uncomment 'pause stalltime to delay the SETTICK by the appropriate time.
  Quote  [09:42:15]> RUN
[09:42:18]OPTION LCDPANEL GDEH029A1, LANDSCAPE, 15, 21, 14, 22
[09:42:18] 09:42:18 25-11-2018
[09:42:18] 42000
[09:43:00] 09:43:00 25-11-2018
[09:43:48] 09:43:48 25-11-2018
[09:44:36] 09:44:36 25-11-2018
[09:45:25] 09:45:24 25-11-2018


Instead of printing the time every 60 seconds, it does it 12 seconds sooner.

Using PAUSE has upset the timing.

Jim

VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10222
Posted: 11:53am 25 Nov 2018
Copy link to clipboard 
Print this post

Jim

I can't reproduce using the latest version posted 7.06 24th November. Please can you check this version with and without the LCDPANEL enabled
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 11:05pm 25 Nov 2018
Copy link to clipboard 
Print this post

The PAUSE problem seems to be specific to one chip.
That's two units that have ended up with strange problems in spite of full erase before loading firmware.

I will do some more testing.
Jim

VK7JH
MMedit
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 09:37am 01 Dec 2018
Copy link to clipboard 
Print this post

Hi matherp

On Armite-32p sometimes it happens that when I give "run" it displays this message:
Restart to activate
… even if I proceed to restart the message appears the same

This is the code:
  Quote  
option autorun on
option baudrate 115200

SetTick 1000,intx
Dim x As integer

Do
x=x+1
Loop

Sub IntX
Print x : x=0
End Sub


What does it mean?
Thanks
Antonio
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10222
Posted: 09:41am 01 Dec 2018
Copy link to clipboard 
Print this post

You can't change baudrate in a program so if the baudrate isn't already 115200 you will get the message as it assumes you need to reset the terminal to the new baudrate and then restart the uP. I'll put a block on the command being used in a program in the next release.
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1982
Posted: 01:56am 31 Dec 2018
Copy link to clipboard 
Print this post

My L4 has been working great with an E-Ink display and HC-12 connected. I just connected a Humidity Sensor that works OK on an E-28. It is an I2C device, connected to D4-SDA and D5-SCL with 4.7K pullups but it wont work. Has any one used the I2C bus with no problems.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1000
Posted: 02:12am 31 Dec 2018
Copy link to clipboard 
Print this post

I used an I2C display on those pins with no issue.

i2c open 400,1000

Latest F4 Latest H7 FotS
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1982
Posted: 03:14am 31 Dec 2018
Copy link to clipboard 
Print this post

OK I was using I2C open 100,500 I tried 400,1000 but still no go. I will try re flashing the chip.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1982
Posted: 03:41am 31 Dec 2018
Copy link to clipboard 
Print this post

OK I reflashed the chip with the last release and still not working correctly, the values I was getting were -40 c and -1% humidity and now I get 101c and 99%.

edit..Flashed again with the earliest Ver. with E-Ink and I am back to Getting
-40c and -1%
I can't help thinking it has something to do with the Firmware.
Edited by palcal 2019-01-01
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 06:06am 31 Dec 2018
Copy link to clipboard 
Print this post

Can you post the code you are using.
I have a SHT21 here that is much the same as the HTU21.
I might have time to play tomorrow.

Jim
VK7JH
MMedit
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1982
Posted: 06:46am 31 Dec 2018
Copy link to clipboard 
Print this post

Thanks Jim but it's New Years Eve and I have to party tonight.
Will post my code tomorrow.
Edit. Aw what the heck just have one less beer.
Here's the code..
DIM as integer TDATA(2) '2 bytes of temp data
DIM as integer HDATA(2) '2 bytes of humidity data

I2c open 400,1000 'Get Temp and Hum. from HTU21D
HTU21D
I2C close
Temperature = Cint(Temperature)
RelHumid = Cint(RelHumid)
InTemp$ = Str$(Temperature,2)
InHum$ = Str$(RELHUMID,2)
Print InTemp;" c"
print InHum;"%"

Sub HTU21D 'TEMPERATURE SENSOR, This is the SUB routine for talking to the HTU21
I2c write &H40,0,1,&HF3 'HTU21 addr= 40 hex, request temp = F3 hex
pause 100
I2c read &H40,0,2,TDATA() 'reads temperature
TEMP1=TDATA(0)*256 + TDATA(1) 'combines both data bytes
I2c write &H40,0,1,&HF5 'request humidity
Temperature=(175.72*(TEMP1/65536))+ -46.85 'HTU21 formula for temp
TEMPCOMP= -.15*(25-Temperature) 'for RH temp comp
pause 50
I2c read &H40,0,2,HDATA()
HUMIDACT=HDATA(0)*256 + HDATA(1)
RELHUMID= ((HUMIDACT/65536)*125)+ -6 ' measured humidity
RFHUMID= RELHUMID + TEMPCOMP 'Temperature compensated humidity
end sub
Edited by palcal 2019-01-01
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 09:09pm 31 Dec 2018
Copy link to clipboard 
Print this post

Happy new year!
I changed your program slightly but didn't touch the HTU21D SUB at all.
I had to add the missing $ from InTemp and InHum variables in the PRINT statements.

Even with a newly flashed chip I received an error with the I2C
When initializing it complains that I2C is already open and when closing:
[13] I2C close
Error: I2C in use for display
>

There is no display configured.

  Quote   DIM AS INTEGER TDATA(2) '2 bytes of temp data
DIM AS INTEGER HDATA(2) '2 bytes of humidity data
ON ERROR SKIP 1
I2C OPEN 400,1000 'Get Temp and Hum. from HTU21D
DO
HTU21D
Temperature =
CINT(Temperature)
RelHumid =
CINT(RelHumid)
InTemp$ =
STR$(Temperature,2)
InHum$ =
STR$(RELHUMID,2)
PRINT TIME$;" ";InTemp$;" c ";InHum$;"%"
PAUSE 10000
LOOP
' i2C close

SUB HTU21D 'TEMPERATURE SENSOR, This is the SUB routine for talking to the HTU21
I2C WRITE &H40,0,1,&HF3 'HTU21 addr= 40 hex, request temp = F3 hex
PAUSE 100
I2C READ &H40,0,2,TDATA() 'reads temperature
TEMP1=TDATA(0)*256 + TDATA(1) 'combines both data bytes
I2C WRITE &H40,0,1,&HF5 'request humidity
Temperature=(175.72*(TEMP1/65536))+ -46.85 'HTU21 formula for temp
TEMPCOMP= -.15*(25-Temperature) 'for RH temp comp
PAUSE 50
I2C READ &H40,0,2,HDATA()
HUMIDACT=HDATA(
0)*256 + HDATA(1)
RELHUMID= ((HUMIDACT/
65536)*125)+ -6 ' measured humidity
RFHUMID= RELHUMID + TEMPCOMP 'Temperature compensated humidity
END SUB


gives:
> RUN
07:55:04 20 c 49%
07:55:14 20 c 49%

The humidity is a few percent lower than a DHT22 running nearby.
This is with a HTU21 chip.

So it does work but I am seeing a strange problem with I2C and non-existent displays.

Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10222
Posted: 11:00pm 31 Dec 2018
Copy link to clipboard 
Print this post

  Quote  but I am seeing a strange problem with I2C and non-existent displays.


Does this solve it?

2019-01-01_090022_ArmmiteL4.zip

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 11:51pm 31 Dec 2018
Copy link to clipboard 
Print this post

  matherp said  
Does this solve it?

Define 'solve'
I no longer get the error with I2C CLOSE but I still need the ON ERROR SKIP before opening.
I2C CLOSE doesn't seem to do anything.
> RUN
[5] I2C open 400,1000
Error: I2C already OPEN
> i2c close
> RUN
[5] I2C open 400,1000
Error: I2C already OPEN
>

In fact, I can remove all references to I2C OPEN from the program.

Time for you to put the party hat on. 10 minutes to go.

Jim
VK7JH
MMedit
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1982
Posted: 01:45am 01 Jan 2019
Copy link to clipboard 
Print this post

@Jim,
Thanks for testing, I was also getting the I2C error. I just connected an RTC to see if that worked, but get an error with RTC SETTIME
  Quote  > RTC SETTIME 2019,1,1,11,41,00
Error: Unknown command
> RTC GETTIME
> print time$
00:02:38
>

I think I might be ditching the L4 soon and using an E-28.Edited by palcal 2019-01-02
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
     Page 6 of 8    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025