N-ka additions

IMG_4506

First a bit of bragging. There will be a workshop with N-ka’s at Stockwerk in Vienna.

Totally free and prepared for beginners. Really 🙂 Anyway – you can register until 19.09.2016 and workshop is on 20.09.2016.

Since CodeBlocks looks like a really nice platform to compile for N-ka the wizard to use CodeBlocks and N-ka is being created. It is in beta and already used in works, so … anyway, you can find the wizard on github. There are also some libraries that were created for N-ka.

But you can download the whole package.

 

Open hardware license

English: Picture of Limor Fried on the Open Ha...
English: Picture of Limor Fried on the Open Hardware Summit 2010, Hall of Science, Queens, NY, USA Deutsch: Bild von Limor Fried auf dem Open Hardware Summit 2010, Hall of Science, Queens, NY, USA (Photo credit: Wikipedia)

When presenting the newest hardware solution called N-ka the question was posted: “What is the license under which you release your hardware?” and I was left speechless.

I didn’t know what to answer since I didn’t take time to study the subject. I somehow know GPL and LGPL (and some other too) licenses for software, but  wasn’t really sure how the open source hardware licenses are being done.

So I started studying the subject. Found more or less two major products: CERN open hardware license and the TAPR open hardware license.

During studying the meaning of different licenses I embarked on this page  which, I think, explains different options.

The art of open hardware portable devices

It’s sort of a press release … for immediate publication (my media friends will get the joke :))

Anyway – I was talking about stm32f030 arm device that was being created. Being busy with creating some libraries (time and display) it took us some time to do this sort of thing (aka letting world know what was created), so here we go.

Ladies and Gentlemen, we are presenting N-Ka.

IMG_4106

As you can see the device sports a TFT display with two buttons at the bottom (if they are not really visible).

The platform is completely open and the scheme will be published in weeks to come. The device includes two clocks, which can be used (you are not obliged to use them :)), but we’d like to use 32.768 kHz clock, to play with time.

Oh and under the display you get access to all the I/O pins, so you can connect the device with outside world and if you don’t need the display you can use some more pins (since few of them are used to communicate with the display).

stm32f030XX and gnu-gcc

A green, glowing SMD (surface-mount device) LE...
A green, glowing SMD (surface-mount device) LED (light-emitting diode) on the Arduino NG board from arduino.cc. The LED is marked with PWR. (Photo credit: Wikipedia)

I’m working with stm32f030xx microcontrollers and obviously needed to program it.

To avoid doing really low level dirty stuff I resorted to using HAL library and tried to do the known Hello world in microcontroller world (blinking LED).

The first thing was to create a library to use. Downloaded the needed files from ST web page. The funny thing is that I needed to hack it a bit since the compilation didn’t went through (got some errors), but at the end the library is created and you can just download it and use it. You need to uncompress the files to a directory next to one with source code (or change paths in Makefile).

After that you just use the regular combination of Makefile and source code file.

# put your *.o targets here, make should handle the rest!

SRCS = main.c

# all the files will be generated with this name (main.elf, main.bin, main.hex, etc)

PROJ_NAME=main

# that's it, no need to change anything below this line!

###################################################

CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy

CFLAGS  = -g -O2 -Wall -T../libs/STM32F031C6_FLASH.ld --specs=nosys.specs
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m0 -mthumb-interwork
CFLAGS += -mfloat-abi=soft

###################################################

vpath %.c src

ROOT=$(shell pwd)

CFLAGS += -Iinc -I../libs -I../libs/inc
CFLAGS += -I../libs/inc/core -I../libs/inc/peripherals

SRCS += ../libs/startup_stm32f030xc.s  # add startup file to build
SRCS += ../libs/system_stm32f0xx.c

OBJS = $(SRCS:.c=.o)

###################################################

.PHONY: proj    

all: proj	

proj: 	$(PROJ_NAME).elf

$(PROJ_NAME).elf: $(SRCS)
	$(CC) $(CFLAGS) $^ -o $@ -L../libs -lstm32f0
	$(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
	$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin

clean:
	rm -f $(PROJ_NAME).elf
	rm -f $(PROJ_NAME).hex
	rm -f $(PROJ_NAME).bin

And the source code:

/**
 *  Blinky project
 *
 *  @author   Tilen Majerle / modified for stm32f0xx by Bostjan Jerko
 *  @email    tilen@majerle.eu / bostjan@japina.eu
 *  @version  v1.0
 *  @gcc    v4.7 20013qr3 / I don't care 🙂
 *  @ide    CooCox CoIDE v1.7.6 / regular command line
 */
#include "stm32f0xx.h"
#include "stm32f0xx_rcc.h"
#include "stm32f0xx_gpio.h"

int main(void) {
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
  GPIO_InitTypeDef GPIO_InitDef;

  GPIO_InitDef.GPIO_Pin = GPIO_Pin_5;
  GPIO_InitDef.GPIO_OType = GPIO_OType_PP;
  GPIO_InitDef.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitDef.GPIO_PuPd = GPIO_PuPd_NOPULL;
  GPIO_InitDef.GPIO_Speed = GPIO_Speed_10MHz;
  //Initialize pins
  GPIO_Init(GPIOA, &GPIO_InitDef);

  volatile int i;
    while (1) {
        // Toggle leds
    	GPIO_SetBits(GPIOA, GPIO_Pin_5);
      	// Waste some time
      	for (i = 0; i < 100000; i++);
		GPIO_ResetBits(GPIOA, GPIO_Pin_5);      	
      	// Waste some time
      	for (i = 0; i < 100000; i++);
    }
}

The LED should be connected to PA5, as you can see from the code (GPIOA and pin 5).

Cell battery data

English: Two identical LR44 button cell alkali...
English: Two identical LR44 button cell alkaline batteries (showing top side and underside). Also known as LR1154, AG13, A76, 157 (alkaline), SG13, S76, 1166A (Photo credit: Wikipedia)

For a project I needed to get power data for different cell batteries so I can try different ones.

Since I couldn’t find any such list I have created one. Mind you it is work in progress and there might also be some omissions, so don’t rely on it 100% 🙂

IEC name ANSI name Nominal voltage (V) typical capacity (mAh) max. discharge current (mA) standard discharge current (mA) Size (R) (mm) Size (thickness) (mm) Weight (g)
CR 927 3 30 0.4 0.05 9.5 2.7 0.6
CR 1025 5033LC 3 30 0.4 0.05 10 2.5 0.6
CR 1130 3 70 1.5 0.1 11.5 3.0 1.1
CR 1216 5034LC 3 25 1 0.05 12.35 1.5 0.7
CR 1220 5012LC 3 35 2 0.1 12.35 1.9 0.8
CR 1225 5020LC 3 50 1 0.1 12.5 2.5 4.54
CR 1616 3 55 3 0.1 15.85 1.5 1.2
CR 1620 5009LC 3 70 3 0.1 15.85 1.9 1.2
CR 1632 3 125 1.5 0.2 16 3.2 1.8
CR 2012 3 55 0.1 20 1.2 1.3
CR 2016 5000LC 3 90 3 0.2 19.85 1.5 1.8
CR 2025 5003LC 3 165 3 0.2 19.85 2.35 2.5
CR 2032 5004LC 3 230 3 0.2 19.85 3.05 3.0
CR 2320 3 110 – 175 3 0.2 23 2 3.0
CR 2325 3 165 – 210 3 0.3 23 2.5 3.0
CR 2330 3 265 6 0.2 23 3 3.8
CR 2354 3 560 3 0.2 23 5.4 5.8
CR 2412 3 100 0.2 24.5 1.2 2.0
CR 2430 5011LC 3 300 3 0.4 24.35 2.85 4.0
CR 2450 5029LC 3 620 3 0.8 24.45 4.80 6.2
CR 2477 3 1000 6 0.2 30 7.7 10.5
CR 3032 3 500 – 560 6 0.2 30 3.2 6.8
CR 11108 3 170 60 11.5 10.6 3

Zigbee, NXP, Jennic in module (JN5168-001-Myy)

2341778-40

Via customer I got few JN5168-001-Myy modules. It’s a Zigbee module by NXP. Since I never really worked with Zigbee there were quite a lot of things to read and study.

Just to test things I decided to try with Jennic IP and according to Google it is a company (web page)… but, they were bought by NXP and the web page is now defunct so where to find tools?

Google didn’t help – all I could find was pointing me to Jennic’s web page. Contacted NXP and got no answer. I decided to contact our local NXP distributer to ask them if  they know where I can find the tools and voila.

I guess I could find the link via search on NXP’s web page, but I just could not. Go figure.