STM32 "for the rest of us"

Interesting

I've not tested this.

I think the LCD library was the one produced by LeafLabs and I'm not sure if its ever been updated :-(

If you have a github account, can you post this as an issue

Guys,

I know some people like to see things visually in a video etc.

So I"ve done an update to my previous video, which describes how to get STM32 working in IDE 1.6.2 or newer

See https://www.youtube.com/watch?v=TePglhSkghg&feature=youtu.be

(Moderators. Sorry for cross posting, but there are 2 different audiences for this project)

Unfortunately I don't have one of those displays.

I have a parallel version but not the I2C version

This issue could be I2C speed, its defaulted to FAST in the Wire lib as this works with most things and gives better speed.

But the speed is faster than the AVR boards (i.e AVR uses 100Khz and I think the STM32 default is more like 250kbps) so this may be the issue.

Its probably worth getting hold of the I2C Scanner from the "Arduino Playground" (written by Nick Gammon) and seeing if the display ID's show up on a scan.

To see if its I2C speed issue, look in

hardware\Arduino_STM32\STM32F1\libraries\Wire\Wire.cpp on the line at the bottom that reads

TwoWire Wire(PB6, PB7, SOFT_FAST);

and change it to

TwoWire Wire(PB6, PB7, SOFT_STANDARD);

which would bring the speed down to 100khz like the AVR boards.

I'm not sure if the version that LeafLabs shipped with the IDE (I.e the one we have) is any different from the normal one.

Looking online, the current version is a lot different from the one we have e.g. the new one can be downloaded from here

http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip

I'd suggest that you try using the latest version instead of the possibly old version we have in the repo

I'll also look at the price of that display, if its just a few dollars I'll order one

Can you confirm if the board you have is this one ? http://www.ebay.com.au/itm/16x2-Serial-IIC-I2C-TWI-5V-1602-LCD-Module-Display-Arduino-UNO-R3-MEGA2560-New-/261819816573?pt=LH_DefaultDomain_15&hash=item3cf5ad5a7d

That board has worked for me with the FMalpartida I2C library... There were some issues with the constructor and varying connections between the PCF8574 and the display. There is a most comprehensive thread in the display section referring to this issue.. I have a level shifter and a 3,3/5V boost mode switcher that I plan to assemble for a Teensy 3,1 next week. I plan to use a 4 X 20 LCD with it.. I just need to get my desk cleared first. It should work well as I've used that library many times before...

Doc

rogerClark: Can you confirm if the board you have is this one ?

More like this one: http://www.ebay.com/itm/Module-Display-Character-LCD-1602-16x2-HD44780-Controller-Yellow-Green-Backlight-/350662659597

...soldered together with this one: http://www.ebay.com/itm/Board-Module-Port-IIC-I2C-TWI-SP-I-Serial-Interface-Arduino-1602-LCD-m2-/131331658861

This is a 5V display - it runs fine on 3.3V but then the contrast voltage must be -0.9V so I run it on 5V with scl/sda pull-up to 3.3V

rogerClark: To see if its I2C speed issue, look in

hardware\Arduino_STM32\STM32F1\libraries\Wire\Wire.cpp on the line at the bottom that reads

TwoWire Wire(PB6, PB7, SOFT_FAST);

and change it to

TwoWire Wire(PB6, PB7, SOFT_STANDARD);

which would bring the speed down to 100khz like the AVR boards.

No luck with this.

Looking online, the current version is a lot different from the one we have e.g. the new one can be downloaded from here

http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip

I'd suggest that you try using the latest version instead of the possibly old version we have in the repo

With this library it works fine - thank you. 8)

Cool

OK. So can you confirm I should remove the LCD_I2C library that is in the current files and replace with the one I linked to ?

Thanks

Roger

@Sunspot

Re: Generic STM32F103C8 board

I have started work on the a generic STM32F103C board type, rather than internally use the "variant" code for the Maple mini

The only difference you should see if you use this, is that pin PB9 is now available. It is not available on Maple mini because its use internally to reset the USB bus

This is somewhat of a work in process, so it would be good if you could give it a try and see if it works for you. Because although the changes I made are not technically very difficult, there is a lot of manual searching and replacing of pin names / numbers.

PS.

I presume you are using the STM32 pin names e.g PA5 - which I feel is definitely the correct way to do things.

Roger I will try but in a couple of days - pin names e.g PA5 work.

The large generic board blinks OK as delivered - it has space for a clock Xtal but none fitted - no real advantage over your small generic board - or the Mini I guess.

3 Maple Mini clones (below £4) arrived from 3 vendors. All blink and none show rework.

Using the Maple IDE on iMac I can program them via USB. I have loaded your USB drivers but do not see the Minis - not sure how to activate the drivers. Guess I can use serial like for generic but will wipe the USB boot SW?

This winter hobby is holding back spring jobs - OK in Oz!!

@Sunspot.

It looks like that large generic board just as a STM32F103C8 uP on it, so I agree its pointless getting one of those

http://www.ebay.com/itm/ARM-Cortex-M3-STM32F103C8T6-Minimum-System-Development-Board-STM32-48-Pin-NEW-/111514106343?pt=LH_DefaultDomain_0&hash=item19f6c239e7

Boards like this

http://www.ebay.co.uk/itm/STM32F103RC-Breakout-Board-STM32-Mini-System-Core-Board-Learning-Board-l-/251691116509?pt=LH_DefaultDomain_3&hash=item3a99f5a7dd

Are better as they have more Flash and more Ram and also have DAC

I think one other person on this thread has one of these (I do)

This board is pricey, but interesting

http://www.ebay.co.uk/itm/STM32-STM32F103RET6-Cortex-M3-ARM-header-board-512k-JTAG-SWD-STM32F103-/350630718937?pt=LH_DefaultDomain_0&hash=item51a3382dd9

As its and F103RET which is the same as used on the Maple RET6 board, and has more flash again (though the same ram)

These are also good value

http://www.ebay.co.uk/itm/1pcs-STM32F103ZET6-Minimum-System-Development-Board-ARM-STM32-Cortex-m3-M75-/291305557264?pt=LH_DefaultDomain_0&hash=item43d32a0d10

64k ram and I think 512K Flash (though it could be 256K, I'd need to double check)

They also have additional flash and eprom on the back

I have one of these, but have not had time to investigate how to make use of the external Flash and eeprom chips, but one of them is definitely connected to the I2C pins as it shows up when I run the i2C scanner

Lots of users enjoy playing with pin and socket boards and for them the larger boards - like the Mega and Uno - are fine.

"Chapter 2" users want to embed a cheap board that is hardly more than a large DIL package with serious speed and memory. They want to build useful - very often portable - devices.

Download, Google to debug, solder, USE!

The full Arduino experience but with small STM32 ARM boards is the goal I would humbly request from the developers forum.

The Maple Mini clone and your small generic are all I ask for - but as always people like me want the quick results that lots of working libraries offer - all fixed for next winter....

Go, developers, Go Go !!! (with sincere thanks :) )

Sunspot: <...> The full Arduino experience but with small STM32 ARM boards is the goal I would humbly request from the developers forum.

The Maple Mini clone and your small generic are all I ask for - but as always people like me want the quick results that lots of working libraries offer - all fixed for next winter....

Go, developers, Go Go !!! (with sincere thanks :) )

@Sunspot: cute, but...

Anyone with some coding experience can also tackle the libraries AS these are difficult because one must have the specific sensor, display, etc.

As the ILI9341, the BMP180, Nokia 5110, etc. are working, all anyone needs to do is use Winmerge against the STM32-centric versions and the AVR versions to identify what was changed. Then, make a few notes and go tackle your own port.

Working libs can be submitted to Roger for hosting if the author does not have a github account. In either case, we would like to include the information that Op_xyz has a working library for device abcd.

Ray My projects

Ray, This looks fun - new to me

  • £2.05 to get a chip on-line

http://www.ebay.co.uk/itm/ESP8266-Serial-WIFI-Wireless-TransceiveR-Module-Send-Receive-LWIP-AP-STA-IG-/261813690063?pt=LH_DefaultDomain_3&hash=item3cf54fdecf

see http://www.esp8266.com/

(insert URL stopped working - odd...)

Sunspot: Ray, This looks fun - new to me

  • £2.05 to get a chip on-line

http://www.ebay.co.uk/itm/ESP8266-Serial-WIFI-Wireless-TransceiveR-Module-Send-Receive-LWIP-AP-STA-IG-/261813690063?pt=LH_DefaultDomain_3&hash=item3cf54fdecf

see http://www.esp8266.com/

(insert URL stopped working - odd...)

Ah, the ESP8266 ... they are everywhere! I have 3 (breakout version) on the bench but have not gotten to play (yet).

Roger has been working on a port for Arduino, but will shortly point to a new effort that seems to be going a bit stronger.

On another note, I have published a new STM32 Project on my Hackster.io page: Mesmerize

mrburnette: On another note, I have published a new STM32 Project on my Hackster.io page: Mesmerize

Hey! It works :sunglasses:

|500x375

Had to change this for my STM32F103RC:

#define TFT_CS          PC7                  
#define TFT_DC          PC6                
#define TFT_RST         PC8

Jens

I'd recommend you post to the other forum, as people are actively working on super high speed access to that display using DMA (Direct Memory Access)

Actually there are various versions of the lib with different attempts at DMA, which achieve very good speeds for certain types of functions, e.g. it depends if you are just setting individual pixels or drawing text or straight lines etc. Work is being done on writing lines to local memory buffer and then writing the buffer to the display via DMA, which is faster than the current method.

Also in the long term, DMA will be asynchronous, so that you can write to a local ram buffer in the main code, then tell the DMA to transfer this to the display in the background, while the main code can do something else

However we need to get "blocking" / synchronous DMA working well before we look at Asynchronous / non-blocking DMA.

OZ2JP: Hey! It works :sunglasses: ... Had to change this for my STM32F103RC:

#define TFT_CS          PC7                  
#define TFT_DC          PC6                
#define TFT_RST         PC8

@Jens, Great!

The info Roger was wanting documented on the main STM32 thread is the display controller model # and the pinout and any other info that you may note in your test that would relate to coding/wiring. This is really helpful. Posting in both threads is appropriate; have as much room here as you want and drop a summary over on the main thread. Thanks!

There are 'nuff fingers in the libs, so except for a few changes such as faux SoftwareSerail.h, I have tried to stay out of their sandbox and concentrate to generic Sketch Code to actually make use of the ported libs Like here

Having a set of simple programs that utilize various sensors and multiple libs is in my Hackster.io projects..

Ray

mrburnette: As the ILI9341, the BMP180, Nokia 5110, etc. are working

Which 5110 libraries are working? I didn't see anything in the repo that said 5110 or PCD8544 so I assume that one or more of the standard ones work unchanged, is that correct?

evildave_666: Which 5110 libraries are working? I didn't see anything in the repo that said 5110 or PCD8544 so I assume that one or more of the standard ones work unchanged, is that correct?

Generic Nokia 5110:

http://www.hackster.io/rayburne/bmp180-barometer-on-arm-32-bit-under-arduino-1-6-0

Added: I am not a really big fan of creating a library for the 5110 as functions work very well. A library would be easy to implement but the Nokia display is so easy to implement with a few functions that I see no particular reason to increase the overhead by using a library.

Ray