Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Armmite L4 battery miser, first beta Post ReplyPost New Topic
Page of 3 Next >>
Author
Message << Prev Topic | Next Topic >>
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2404
Posted: 08 November 2018 at 7:38pm | IP Logged Quote matherp

Please find attached a first beta of MMBasic running on the STM32L432. Recommended platform is the NUCLEO-L432KC.

2018-11-08_184619_ArmmiteL4.zip

Use the STM32 ST-LINK Utility to flash the chip

Valid CPU speeds and power figures are:

CPU    Power
80     11.2mA
48     6.43mA  default
32     4.44mA
24     3.45mA
16     2.49mA
8     1.4mA
4     0.9mA
2     0.65mA
PAUSE     0.57mA - unless PWM is active
SLEEP     1.8uA


NB: even when sleeping the RTC is running and the time and date will survive resetting the processor but obviously not power down or reflashing.

There are a number of things to understand about these figures:
1: you must cycle the power after flashing the chip otherwise sleep values will be much higher
2: Switching to CPU 80 and then back to one of the slower modes will increase power utilisation slightly as the PLL cannot be disabled without resetting the chip
3: Clocks for COM1, ADC, I2C, DAC, random number generator and PWM are turned off on reset. Using each of these functions will incrementally increase power very slightly during running and sleep.
4. These figures are measured at JP1 on the Nucleo. To use the Nucleo without the ST-LINK being powered remove SB4 and power the Nucleo with 3.3V at the 3V3 pin.
5. The TEMPR commands and functions will transparently increase the clock speed during communication if the CPU speed is below 24MHz
6. The WS2812 command will transparently increase the clock speed during communication if CPU speed is below 80MHz

Pinout is as per the attached table. The parameter in quotes is the Nucleo silkscreen identifier

          { NULL,  0, PUNUSED , NULL, 0,""},                                                                 // pin 1 VDD
          { NULL,  0, PUNUSED , NULL, 0,""},                                                                 // pin 2 OSC32_IN
          { NULL,  0, PUNUSED , NULL, 0,""},                                                                 // pin 3 OSC32_OUT
          { NULL,  0, PUNUSED , NULL, 0,""},                                                                 // pin 4 NRST
          { NULL,  0, PUNUSED , NULL, 0,""},                                                                 // pin 5 VDD
          { GPIOA,  GPIO_PIN_0,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_5,"A0"},    // pin 6 COUNT/WAKEUP/IR
         { GPIOA,  GPIO_PIN_1,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_6,"A1"},    // pin 7 SPI-CLK
          { NULL,  0, PUNUSED , NULL, 0,""},                                                            // pin 8 Console-TX

          { GPIOA,  GPIO_PIN_3,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_8,"A2"},     // pin 9 PWM2A
          { GPIOA,  GPIO_PIN_4,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_9,"A3"},     // pin 10 DAC1
         { GPIOA,  GPIO_PIN_5,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_10,"A4"},    // pin 11 DAC2
         { GPIOA,  GPIO_PIN_6,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_11,"A5"},    // pin 12 SPI-IN
         { GPIOA,  GPIO_PIN_7,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_12,"A6"},    // pin 13 SPI-OUT
         { GPIOB,  GPIO_PIN_0,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_15,"D3"},    // pin 14
         { GPIOB,  GPIO_PIN_1,  DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_16,"D6"},    // pin 15
          { NULL,  0, PUNUSED , NULL, 0,""},                                                            // pin 16 VSS

         { NULL,  0, PUNUSED , NULL, 0,""},                                                            // pin 17 VDD
          { GPIOA,  GPIO_PIN_8,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D9"},                                   // pin 18 PWM1A
          { GPIOA,  GPIO_PIN_9,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D1"},                                   // pin 19 COM1-TX/(PWM1C to be implemented)
          { GPIOA,  GPIO_PIN_10, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D0"},                                   // pin 20 COM1-RX/(PWM1D to be implemented)
          { GPIOA,  GPIO_PIN_11, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D10"},                                   // pin 21 PWM1B
         { GPIOA,  GPIO_PIN_12,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D2"},                                  // pin 22 USART1-DE/COUNT
          { GPIOA,  GPIO_PIN_13,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,""},                                  // pin 23 SWDIO - not broken out on Nucleo
          { GPIOA,  GPIO_PIN_14,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,""},                                  // pin 24 SWCLK - not broken out on Nucleo

          { NULL,  0, PUNUSED , NULL, 0,""},                                                            // pin 25 Console-RX
         { GPIOB,  GPIO_PIN_3,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D13"},                                       // pin 26 Green-LED/SPI2-CLK
         { GPIOB,  GPIO_PIN_4,  DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D12"},                                       // pin 27 SPI2-IN
         { GPIOB,  GPIO_PIN_5, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D11"},                                        // pin 28 SPI2-OUT
         { GPIOB,  GPIO_PIN_6, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D5"},                                    // pin 29 I2C-SCL
          { GPIOB,  GPIO_PIN_7, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"D4"},                                    // pin 30 I2C-SDA
          { NULL,  0, PUNUSED , NULL, 0,""},                                                            // pin 31 BOOT0
         { NULL,  0, PUNUSED , NULL, 0,""},                                                            // pin 32 VSS


In all MMBasic commands the Nucleo identifier can be substituted for the pin number e.g.


SETPIN D13,DOUT
PIN(D13)=1 'light LD3
? TEMPR(A5)
PORT(A0,3,D2,3)=&H3F


Very slow clock speeds may compromise activities like editing

The command set is the same as the MM2 with the following exceptions:

Missing:
all drawing, font and TFT capability
obsolete commands and functions as per MM2 manual
RANDOMIZE command, STM32 has hardware random number generator so not needed
LIBRARY command

Added:
DISTANCE command as per earlier versions of MM2
DHT22 command as per earlier versions of MM2
LONGSTRING commands and functions as per MMX/ARMMITE H7
WS2812 command as per MMX/ARMMITE H7
DAC command as per ARMMITE H7
DAY$ function as per ARMMITE H7
SPI2 commands and functions as per MM+/MMX/ARMMITE H7

Different:
TIME$ command sets the value from the RTC
TIME$ function returns the value in the RTC
DATE$ command sets the value from the RTC
DATE$ function returns the value in the RTC
MM.DEVICE$ returns "ARMMITE L4"

Other:
Things I've forgotten




Edited by matherp on 08 November 2018 at 8:19pm



Back to Top View matherp's Profile Search for other posts by matherp
 
circuit
Regular Member
Regular Member


Joined: 10 January 2016
Location: United Kingdom
Online Status: Offline
Posts: 52
Posted: 08 November 2018 at 8:18pm | IP Logged Quote circuit

Bucketloads of appreciation, sir! My board is due in from RS this morning and I am most excited about exploring the potential of this new chip. Peter, your efforts are most valued.
Back to Top View circuit's Profile Search for other posts by circuit
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2712
Posted: 08 November 2018 at 8:34pm | IP Logged Quote TassyJim

My parcel arrived from Element14 today so something to do tomorrow
Thanks Peter


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
lizby
Senior Member
Senior Member


Joined: 17 May 2016
Location: United States
Online Status: Offline
Posts: 255
Posted: 08 November 2018 at 10:44pm | IP Logged Quote lizby

Great work and thanks. My L4s should arrive next week from Digikey.

Are benchmark times at 80mHz still showing about the same as the MX170? If so, any handle on why that may be (e.g., L4 instructions take more cycles, more instructions required for same amount of MMBasic work)?

Does your list of instructions included and excluded imply that all SD card interactions are available (that alone would make this a valuable step-up from the MX170 in certain circumstances, even at the same speed)? If so, what does MEMORY show initially? (I personally would be glad to give up some MMBasic memory to gain full SD card use.)

Love the wake-up from IR option.
Back to Top View lizby's Profile Search for other posts by lizby
 
Volhout
Regular Member
Regular Member


Joined: 05 March 2018
Location: Netherlands
Online Status: Offline
Posts: 77
Posted: 08 November 2018 at 11:25pm | IP Logged Quote Volhout

amazing !!!

less than 2 weeks ago, there was a post called "thinking about...."
and today the platform is chosen, and the code is in beta.....

matherp, you are a giant !!!

Volhout

__________________
If nothing goes right ... turn left
Back to Top View Volhout's Profile Search for other posts by Volhout
 
JohnS
Guru
Guru


Joined: 18 November 2011
Location: United Kingdom
Online Status: Offline
Posts: 1698
Posted: 09 November 2018 at 12:02am | IP Logged Quote JohnS

Bottom of this thread - looks like no SD.

SD card

John


Back to Top View JohnS's Profile Search for other posts by JohnS
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2404
Posted: 09 November 2018 at 12:12am | IP Logged Quote matherp

Quote:
Bottom of this thread - looks like no SD


Longer term my thoughts are to include SPI flash support with SPIFFS
Back to Top View matherp's Profile Search for other posts by matherp
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2404
Posted: 09 November 2018 at 2:34am | IP Logged Quote matherp

I've now included support for drawing functions and user mode display drivers

2018-11-09_022053_ArmmiteL4.zip




The example program uses the STM to switch power to the display so, as seen in the picture, the display is actually powered off - zero current usage - and the STM32 is sleeping @1.8uA. Based on using a normal 18650 LiFePo cell this should run like this for just over 100 years

2018-11-09_022827_epaper2.9.zip
Back to Top View matherp's Profile Search for other posts by matherp
 
circuit
Regular Member
Regular Member


Joined: 10 January 2016
Location: United Kingdom
Online Status: Offline
Posts: 52
Posted: 09 November 2018 at 2:38am | IP Logged Quote circuit

Well, I am up and running. Code downloaded okay with ST-Link. I am using MMEdit to communicate and I was able to run direct commands okay. MEMORY declared itself fine, MM.VER also but there seemed to be no response to CTL-C. Then I uploaded a simple DO-LOOP to flash the green LED and it ran fine. Then I set OPTION AUTORUN ON and now I cannot get it to BREAK. I have tried sending breaks in MMEdit and in Teraterm but the green LED just keeps flashing away.

I guess that I will just try and reload the code later.
Back to Top View circuit's Profile Search for other posts by circuit
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2404
Posted: 09 November 2018 at 3:08am | IP Logged Quote matherp

Quote:
ran fine. Then I set OPTION AUTORUN ON and now I cannot get it to BREAK.


Why is the first thing users do with new firmware is tell it to autorun
and why is it that in development it is the one thing you never test as it is completely irrelevant to developing and testing the main functionality

Try this:

2018-11-09_051818_ArmmiteL4.zip

Edited by matherp on 09 November 2018 at 5:18am
Back to Top View matherp's Profile Search for other posts by matherp
 
OA47
Guru
Guru
Avatar

Joined: 11 April 2012
Location: Australia
Online Status: Offline
Posts: 546
Posted: 09 November 2018 at 7:10am | IP Logged Quote OA47

Thanks heaps Peter, it looks like this weekend may not be as dull as first thought.
OA47
Back to Top View OA47's Profile Search for other posts by OA47
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2712
Posted: 09 November 2018 at 3:05pm | IP Logged Quote TassyJim

ctrl-C works as expected with a running program but if you do crtl-C while at the command prompt, it sits in the input buffer until another character is sent.

try ctrl-C
NEW

and you get
Quote:
> n
> ew
Error: Unknown command
>


I thought MMEdit was broken for a minute.


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 


Page of 3 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1250 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.12