Search Results

Keyword: ‘STM8’

Touch Sensing Library in STM8

June 18, 2010 Leave a comment

It took me a while to get everything up and running with the STM8S-Discovery board. The board is nice and cheap, the tools are a bit awkward (especially if one compare them to the tools that can use for PC development) but they are ok. One thing that is missing is the documentation. The papers which are on the ST page are lacking some basic informations and some are even outdated (watch out on the zip files that contains several libraries). The support from the community don’t exist at the moment so one thing that came to my mind was to browse the internet.

A proper tutorial on how to use the firmware supplied by the ST can be found on Ben Ryves page:

The people in ST should learn form him (at least about how the app notes for starting with their firmware should look like).

Going through the tutorial took me several hours and finally all was working as it supposed. It was a time to design my own touch button. ST has two app notes on the design for touch sensing panels.

– AN2869 – Guidelines for designing touch sensing applications

– AN2927 – RC acquisition principle for touch sensing applications

Those app notes are enough to design a working button but they lack some explanations. A good point to get under the hood might be the Atmel page and their app notes.

For the board design I used Altium Designer. Last time that I worked with it was like 3 years ago so I had to go through the tutorial again. The basics didn’t change so it was not painful at all. The first board that I manufactured was incorrect and I had to develop my own set of constraints for home made PCB. Below you can see the schematics and the 3d view of the board (oh, and Altium probably can import the VRML so I can use the Wings 3D to do the parts models).

This board isn’t the best one and I would change few things there but it works so there is no sense to update the project. The code for the microcontroller was the same as the one which is in the tutorial with a small change in configuration of the TSL. I used port B to connect the touch button. You can see the assembled touch key module below. It has a size of approx. 30×20 mm. The button cover is made out of a part of  a plastic CD cover (I need to find a better solution for that as it is hard to cut it as it cracks when you try to do something with it).

When assembling the board I did not connect the shield. I did not want to modify the design as it was only a matter of soldering a joint and not soldering a resistor so I defined an assembly variant in the project. I have to say I am impressed how the Altium is constantly adding new solutions to the Designer and keeps the mainstream untouched (the use of the program is exactly the same as the DXP I used few years ago).

The next stage is to develop the slider and maybe a wheel. I will design the boards to be used with STM8 and then I will wait for the new Altium Designer for year 2010. It will include a module to lay out the capacitive buttons for the Atmel QTouch library and devices. I will postpone the part with the HW controller solution until it will be released.

Categories: Uncategorized


July 15, 2010 Leave a comment

Finally I made the slider board for the STM8-Discovery evaluation board. It took me almost 4 days to finish. I used the Eagle EDA software to design it. The Eagle might have a steep learning curve but after two days I am finally done with it. I did not want to do the schematic so I just went directly to layout editor and designed the board. The slider for STM8 Touch Sense Library can have 5 or 8 sections and its parameters are defined in the AN2869 application note. A figure from it is presented below.

I planned to view the board in 3d as I did previously with the KiCad and Altium Designer. Eagle does not support such views by default. Fortunately one can find a package for using pov-ray to render the board on the internet. The outcome you can see below.

Manufacturing the board at home was easy as I have all the necessary equipment already set up. The finished board you can see below. The soldering was a bit tough as I did it at 5 o’clock in the morning so it isn’t the best I’ve done (actually it is awful). The dielectric cover is a piece of microSD card package (they come in a big piece of plastic that you usually throw out immediately- so now there is a reason to leave them for future use).  The piece of plastic was glued to the PCB.

Nevertheless the board was verified electrically and then tested with STM8-Discovery. The best way is to connect the slider, configure the library and watch the position variable to see if it is properly set. The ST Visual Develop allows to use real time updates on the watch window. This allows to quickly verify the design.

One issue that I saw are those two slider pad halves at the beginning and at the end of the slider. The documentation does not define how they should be connected. The configuration file also does not clarify the situation and I think it would work better with all 5 pads of equal size. I will send a question to ST-Microelectronics and post the answer later.

Categories: Uncategorized

Capacitive sensing

June 8, 2010 Leave a comment

I am back to work after a long sick leave (almost a month). Two days ago I bought an electronics magazine and I found a nice article about capacitive sensing. The outcome of the time I spent reading it is that I need to do some experiments with that technology. After a day of planning I made a final decision. I will buy an evaluation kit from ST Microelectronics which has a Touch Sensing Library that makes the SW design easier. The STM8-Discovery board (at the picture) is divided into two parts. The first part is a programmer/debugger (ST-Link) and the second part is a microcontroller board both are drawing power from the USB. I have to say that this is a pretty basic kit as the board has only one touch sense button and all the pins are routed to  DIL outputs. Also a small prototyping area is available. Anyway what would one expect for less than EUR10?

I am ordering the board today so it should arrive tomorrow. The buttons will be made on a FR4 laminate with a piece of plastic as a cover. I will use a part of top of a CD cover as I have some spare that I don’t need. I will glue some transparent foil to mark the buttons. Manufacturing the board will take two days as I do not have the footprints for such buttons (I use Altium Designer nowadays).  By the end of the week I should have a working system.

Later on a special controller will arrive. I have chosen a QT240 IC (manufactured by Atmel) that can control four capacitive buttons. It is easily available from Farnell (a great place to buy electronic parts – delivery next day, 5EUR shipping fee). This is just to verify the HW vs SW solutions. I might have some problems with the test procedure but this I hope to solve in the coming week. The last part will be a board for the STM8 to evaluate a  slider and a wheel. I am thinking about using an RGB LED to show the slider/wheel movement. If you know about a RGB LED driver IC that is easy to solder and controlled via SPI/I2C then please let me know. At the moment I am considering the drivers from National Semiconductor but I am not happy about their IC packages. Or maybe it is a sign to buy a hot air?

As a final word – time frame – it should take me two weeks to finish with an additional week as a spare. At the moment I am looking for a new job here in Poland so I might need some time to write the cover letters.

Categories: Uncategorized