-
Love it? Support it!
02/22/2023 at 20:38 • 0 commentsI've just opened a page on Patreon: www.patreon.com/salychev.
No updates for the project have been published for a long time. Some fuel might help to kick it again!
-
A static scene with parallax effect
01/21/2021 at 17:33 • 2 comments -
Xling v4.0 - a plugin for GIMP, improved graphic functions and updated PCB
01/13/2021 at 14:04 • 0 commentsIntroduction
It's been quiet here for a while and it might be a good moment to provide an update describing what's been done during previous months.
I've been working on Xlingtool, a plugin for GIMP based on LCD Image Converter and a new way to draw and export scenes for Xling, which is essential to finish firmware part of the project. There are several improvements in the graphic functions which allow to draw a visible part of an image on the canvas when it's top-left corner has negative coordinates. PCB itself has received several updates including new switches with ground terminals (hopefully, more robust) and a battery socket to prevent a short of its wires during soldering.
Xlingtool
GIMP has an attractive user interface and allows to modify an image with many layers. It supports plugins which can be written in C or Python and usually used to implement various raster effects and filters. Plugins have an access to the whole image including its layers and raw data. This can be used together with the image converter to prepare and export a whole scene composed of several static images and animations directly into C code.
Xlingtool does exactly this. Moreover, it uses SHA-1 hash as a name of the exported file which is calculated based on the image data. This feature allows to use layers with duplicated images in a scene construction process, but prevents a scarce flash memory of ATmega1284P to be occupied by duplicated image data.
Once scene is ready, it can be exported into a set of C header files by pressing Filters > Tools > xlingtool... Scene in the example above contains 100 layers, but only visible ones and layers without !ignore() tag will be exported. You'll find similar files generated by Xlingtool in the repository. Let's take a closer look at the scenes.h:
The most important part here is XG_SCNL_smoking_02, an array of scene layers which will be used by the graphic functions to draw a whole scene on a canvas which will be transferred to the display memory once the scene painting process is finished.
Order of the layers in scenes.h is the same as in GIMP, i.e. layer with the smallest index will be placed on top of the others.
There's a special !kbd() tag which tells the plugin to generate a prototype of the keyboard callback function. For example, scene on the picture above contains a dedicated layer with the tag used as a name which forces the plugin to add XG_SCNKBD_smoking_02(XG_ButtonState_e, void *) to the scenes header file. Obviously, there should be an implementation of the function provided. This keyboard function is called right before the next iteration of the scene drawing loop in the display task.
Two types of the layer objects are available at the moment: images and animations with XG_IMG and XG_ANM prefixes accordingly. Xlingtool also generates an anim.h file where each scene animations are defined:
Each animation has its own array of frames defined with XG_ANMF prefix, and each animation frame has a chance to select an alternative frame to be drawn next instead of the frame which goes right after the current one, i.e. XG_ANMF_RightEye[0] has a 98% chance for XG_ANMF_RightEye[8] to be drawn next instead of XG_ANMF_RightEye[1].
This mechanism helps to create non-linear, complex and interesting animations.
The plugin may produce a lot of files with SHA-1 hashes in their names depending on a number of layers in a particular scene and only two human-readable files described above. Scene itself can be drawn on a canvas using a simple function from xling/graphics.h which is designed to be called in a loop in order to update animation frames:
Improved graphic functions
I've already had a function to draw images on a canvas at the non-negative coordinates. It worked quite well when only a part of the image was visible due to its placement and size. However, it was impossible to use negative coordinates there.
I'm talking about XG_Draw_PF() function which uses a new CALC_AUX_POINT() macro added to calculate an auxiliary point with non-negative coordinates (x, y) which will be used as a new top-left corner to draw a visible part of the original image only. In addition, an "idx" offset in the image data array, width and height of the new image will be provided:
You'll find more details in this commit. Don't be afraid of many changes there. All of the scene files have been generated by Xlingtool. The rest of the XG_Draw_PF() function hasn't been changed at all.
4th revision of the board
Noticeable changes here include a low-profile Pico-EZmate header and TVCU11BB switches with ground terminal. According to @Marianne Primeau Breton, it was hard to solder battery pins without shorting them on a previous version of the board, but new header should help with these troubles. New buttons should be a bit more durable comparing to the ones I used previously (even during a manual PCB assembling).
Demo
Let me show a complex, animated and interactive scene up and running. Enjoy!
Happy New Year and have a good time!
-
Exy’s waiting to be animated more
09/29/2020 at 19:16 • 0 comments -
Xling v3.2 - updated board, PCBWay review and firmware bugs fixed
03/21/2020 at 19:06 • 0 commentsIntroduction
I'm going to include a review for PCBWay service as a part of this update because they supported me with the current iteration of Xling v3.2 and manufactured black PCBs for free.
However, I'd like to keep it as fair as possible because everyone should benefit in this case. On one hand, everyone who's reading it will be able to understand what PCBWay is capable of. On the other hand, PCBWay will be able to see what they might improve in their service.
Personally, I'd like to thank DI HALT and his blog, easyelectronics.ru. I read it from time to time with pleasure. Besides, an article about PCBWay helped me a lot.Let me show you how Xling looks like in its current iteration fully assembled and in a 3D-printed case.
Just as I imagined!How to configure PCB
There are many parameters to tweak in order to quote a PCB production, and some of them might not be obvious enough. I'll try to describe them briefly and spend more time for obscure ones.Board type parameter means a way to prepare PCBs. You'll receive boards in single pieces in case of the first option which is suitable for prototypes or a small batch production. The second and third options which start with Panel by... might be useful in case of an automatic assembling and a mass production and allow you to select your own size of a panel (Panel by Customer) and let PCBWay populate it with your boards, or let PCBWay to do all of these steps (Panel by PCBWay).
Please, note that in case of a single board it's necessary to select Size of a single board only, but in case of a panel, these are dimensions of the whole panel which might contain several boards. The same rules are applicable for Quantity which means a number of single boards or a number of panels accordingly.
Generally speaking, it's not obvious why somebody would let PCBWay to decide how to panel her boards because dimensions of a panel depend on a specific assembly equipment. However, PCBWay offers an assembly service also and the third option is useful in this specific case.
There are several ways how boards will be connected within a panel. In case of V-Scoring PCB material will be cut for a half of its height to simplify a break off. In case of Tab Route boards will be attached to a panel and among each other by narrow bridges.
It might also be necessary to include different designs into a single panel, but it'll increase its price.
Another option called X-out Allowance in Panel gives an incredible ability to reduce an overall cost of the panel by about 30%. It's useful if you can tolerate a PCB in the panel to fail electrical testing. It'll be marked by a cross in this case.
You shouldn't usually worry about number of Layers because it can be obtained automatically from Gerber files provided within an archive.
Material is what PCB is manufactured from, where FR-4 is epoxy glass cloth (the most widely used material for PCB, probably) and the rest.
Personally, I'd like to mention FR4-TG which stands for a glass transition temperature and defines some thermal and chemical properties of the material. One of the most important things which is affected by this temperature is board geometry which is critical in case of really narrow routes and precision PCBs. The higher the temperature, the better PCBs can be manufactured, but overall cost will be increased also.
Another important option is HDI (Buried/blind vias) which stands for High Density Interconnect PCBs. In this case RCC (Resin Coated Copper) is applied to epoxy glass cloth which leads to fine circuits.
These are limits for tracks/spaces and size of the holes. Please, be careful and select them according to your design.
It's interesting how minimal these options are. For example, you cannot select a limit for annular ring, but a diameter only. Personally, I'd recommend to read about PCBWay capabilities first in order to stay within limits and reduce amount of money to be spent on PCB production.
There is a plenty of Solder Mask colors available, but unusual ones might affect an overall price of the PCBs. This is especially true and a subject to double check in case of Matte black and Matte green options.
Gold fingers are useful when there are contact pads on a side of your board (like on various PCI cards in your PC). This option helps to tell PCBWay to cover only these pads with immersion gold (ENIG) instead of the whole PCB copper. Another way to reduce costs.
Be careful with the material for gold fingers! It's a "hard gold" by default which could easily lead you to bankruptcy.
I'd like to stop at Surface Finish options and explain them in details. There are several ways to process copper layers in order to satisfy soldering requirements (plain surface is usually necessary for fine pitch ICs, for example) and/or protect copper from environment.
HASL, which stands for Hot Air Solder Leveling, is a cheap and affordable option which can also be used to repair your prototypes, i.e. it's easily re-solderable. It comes in two flavours with lead (a chemical element with the symbol Pb) and without.
I strongly recommend you to use only lead-free HASL for all of your prototypes in order to avoid potential harm for humans and nature. Please, remember that lead is a highly poisonous metal, affecting almost every organ and system in the human body.
OSP, which stands for Organic Solderability Preservative, is some kind of a varnish for copper layers which protects it. OSP makes copper flat enough and allows you to use almost any solder (lead and lead-free). However, it can be damaged easily which makes it a poor choice if you're going to store your PCBs for any significant amount of time, e.g. more then several months.
ENIG, which stands for Electroless Nickel/Immersion Gold, is some kind of a "pie" where copper layers are covered by nickel, and nickel itself is protected by gold. A perfectly flat surface is the result of such process which doesn't have shortcomings of the OSP. However, a "black-pad" could form during the electroless nickel plating step which reduces solder joints reliability. Anyway, ENIG might be necessary if you've large BGA packages on your boards. And it usually increases costs.
ENIG might look like an expensive option for the first sight, but price per PCB can be significantly reduced by ordering even a small batch of, say, 50 pieces.
For example, 5 single pieces of Xling v3.2 cost me $66 (including DHL delivery) with ENIG surface finish which means that I pay $66 / 5 = $13.2 per PCB. However, 50 single pieces of Xling v.3.2 cost me $85 (including DHL delivery) which means that I pay $85 / 50 = $1.7 per PCB.
Almost 8 times less!Immersion silver (Ag) combines the advantages of ENIG and HASL, but might suffer from rapid surface degradation because of oxidation. And, of course, it's expensive even for 50 pieces batch.
Via Process shouldn't usually be tweaked at all because a required value will be obtained from your Gerber files from an archive.
There is a nice additional option available which allows you to remove any production marks from your PCB, but it costs $3 extra.
This configuration has been used to prototype Xling v3.2:
Board type: Single PCB
Size: 35 x 47 mm
Material: FR-4
FR4-TG: TG 130-140
Thickness: 1 mm
Solder Mask: Black
Surface Finish: HASL lead free
Layers: 2 layers
Min Track/Spacing: 6/6mil
Silkscreen: White
Additional Options: Extra PCB product number removedIf you're going to panel your PCBs, it might also be necessary to have a stencil.
How to configure SMD stencil
SMD stencil is particularly useful in a stencil printing process which allows you automatically populate solder paste to pads on a board.
Stencil type means a way to prepare a stencil (with frame or without). It depends on your assembly equipment.
Size of a stencil can't be smaller than a panel itself, but can easily be bigger. It also depends on the assembly equipment.
Be careful with a "single board" type (or incorrect panel size) and SMD stencil. You might be lucky enough to receive a huge sheet of metal with a little stencil for a single board cut at the center.
It might be necessary to have stencil for top and/or bottom side of a PCB or a combination of them. Stencil Side parameter helps here.
Thickness of a PCB stencil allows you to choose how much solder paste will be left on pads. This parameter is defined by a smallest pad on the PCB.
Thanks to DI HALT, we've a table and a diagram to select a correct thickness.
Existing fiducials are some kind of markers on a stencil to place it on a panel correctly. They can be engraved (half lasered) or cut through (lasered through).
Electropolishing helps to avoid sharp edges (which might remove a small, but significant amount of solder paste from tiny pads) after laser cutting. It makes sense for anything smaller than 0805.
Production time
It took about three days from my order posted to its shipping. So, in this case service was exceptionally fast.
A closer look to PCB
This is how boards look like without a microscope:
Everything seems fine for the first sight. Even a silkscreen picture looks really good to me. Let's take a closer look:
All of the pads seem fine. Even the smallest ones for OLED flat flexible connector look good to me. There are minor issues with silkscreen, but it could be my mistake during PCB design. All of the labels are readable.
I spent some time assembling a prototype:
Firmware bugs fixed
I'd like to mention a specific commit in the Xling repository which helps to fix device hanging on a way from/to sleep mode.
To sum it up, I got rid of the direct control functions to manipulate the FreeRTOS tasks like vTaskSuspend() and vTaskResume() in favor of the tasks notification API including xTaskNotify(), xTaskNotifyFromISR() and xTaskNotifyWait(), and implemented a simple latching mechanism for ISRs of the Sleep Mode task.
Have a good time!
-
Xling v3.1 - an animation demo, more checkpoints, 4-wire SPI and FreeRTOS
11/17/2019 at 19:45 • 0 commentsAlmost a month and a half passed since the previous update (not so much comparing to v0.3, eh?) and I'm here to share some details regarding the overall progress.
First of all, I've finally got rid of the leading zero in the Xling PCB version because there are no chances that I'll be brave enough to change it in future. So, v0.3.1 became v3.1 and it means that the most recent changes of the Xling PCB will find their way into current/3.0 branch of the repository.
Note that it has nothing in common with the firmware version of Xling. The most recent changes in code find their way into current/0.4 branch of the Xling-firmware repository
Animation demo
Anyway, I'd like to show you a walking animation demo at 24 FPS. There are only 4 images of the animation where each one stays on a screen during two frames.
However, a driver for SH1106-based displays I've been working on can do its best and produce the same animation at full speed:
You're probably interested in the technical information on the screen. Here it is:
- BAT_LVL - a raw ADC value of the battery voltage (voltage divider, ADC3, 10-bit, Vref = 1.1 V).
- BAT_STAT - a single bit, which is grabbed directly from the MCP73831 STAT pin (1 - when the battery current, Ibat, is below a selected threshold, Iterm, 0 - otherwise).
- Number of frames to re-draw before calculating a delay.
- Time spent to re-draw the frames.
- Current FPS (according to 3 and 4).
More PCB checkpoints and 4-wire SPI
-
Xling v0.3 - an artistic PCB, ATmega1284P and white OLED with SPI
10/05/2019 at 18:45 • 2 commentsThe whole summer has passed and I've finally finished the next version of the toy according to my plan. There are several significant changes which you've probably noticed:
The first one doesn't carry any technical function, but provides a unique look and feel of the PCB (many thanks to SierraSaura for this picture).
The second change is a new ATmega1284P MCU which replaces the previous ATmega328P one.It is the most important improvement over the previous versions because of the 32 KiB -> 128 KiB flash memory (the only memory on the board to carry a lot of the graphic sprites, for example). An amount of RAM has also been increased from 2 KiB on ATmega328P to 16 KiB on ATmega1284P.
The third change is almost the same OLED display which color is white now instead of the yellow on the previous prototypes and connected using SPI.All of the previous displays with SH1106 controller were connected via two-wire interface (TWI, another name for I2C) which is relatively slow comparing to the SPI.
However, a driver for the SH1106-based displays I'm working on doesn't support SPI yet. This is the next step on my way and this new Xling v0.3 will help me testing it.
Anyway, if you have any questions and ideas on your mind, feel free to tell me then.Have a good time!
-
Actual size (height)
05/24/2019 at 18:45 • 0 comments -
Actual size (width)
05/24/2019 at 18:38 • 0 comments