STM32 Buildchain

January 10th, 2010 tlied2 No comments

So I’m quite frustrated with trying to roll my own arm-elf- toolchain. Building it was easy enough, but getting the options right is proving to be challenging. I managed to work through all the hard/soft FPU stuff with newlib, and got things to compile, but still some linker warnings/errors that result in the app crashing on the hardware. One day I’ll learn to debug and look into this more.

In the meantime, even though the download link for it is quite well hidden, I have discovered that I am quite happy with Codesourcery’s G++ Lite edition. It includes the GNU ARM buildchain, along with some of their proprietary tools (so no, I can’t mirror it :-( ) as an unsupported command line only free version with a license that looks very reasonable to me, so I’m pretty comfortable working with it. Thanks to those responsible for make the Lite version exist, now if only we could get an arm buildchain in the repos…

To save you the trouble of accidentally downloading their full suite trial edition like I did (feel free to purchase it if you want an IDE and other tools), here is a link to the downloads:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite
You will want to select the EABI (first) link (unless you need a different target OS, which for an STM you probably don’t)
The first links for the Installer are the easiest to use, everything is packaged in a Java installer to extract and setup your path, make links, etc)

I’ve been using Randomskk’s STM32 Skeleton project Randomskk’s GitHub, he has a rather nice blinking LED example in there (I had to change the LED pin for my board and fixup the Makefile to have tabs, but that was all painless).

Now to see if I can get FreeRTOS to build under arm-none-eabi – what fun, doesn’t look like it will be trivial based on the errors I’m getting so far, but I can’t imagine it should be too bad.

Categories: ARM Projects Tags:

Bizarreness

January 10th, 2010 tlied2 No comments

So we all know that GSM phones can induce various sounds in unshielded amplified speakers, but ever have one take over control of your machine?

I recently got a new Blackberry 8320 and switched it from T-Mobile to AT&T (work phone). Whats fun is that when I set it down to the right of my keyboard (by the mouse and my Polycom) my cursor starts doing strange and interesting things when its radio is active – cursor movement, right clicks/half-clicks, etc – just weirdness. Now if this were an RF mouse or something, sure, but this is a wired, USB, optical mouse, which makes it seem odd. Any theories? Anyone know if optical mice have an ADC anywhere in the input chain?

Categories: TKJ Electronics Tags:

STM32 OpenOCD Config

January 10th, 2010 tlied2 No comments

Below is the openocd config I am currently using with my STM32 (Olimex STM32 header board from SFE) to program through the JTAG header on the board. Randomskk had better scripts, but they didn’t want to behave for me. Its rather minimal, but it does the job. TODO: integrate changes back into the skeleton project.

Tested on FC10/FC11 with openocd 0.3.1

GIves some weird warning know – run with sudo openocd -f thisfile.cfg 2>&1 | grep -v khz for readable output (filters the repetitious warning)


telnet_port 4444
gdb_port 3333

interface parport
parport_port 0
parport_cable wiggler

jtag_khz 1000
jtag_speed 0

source [find board/olimex_stm32_h103.cfg]

init
reset halt
stm32x mass_erase 0
#flash write_image main.elf 0 elf
#verify_image jtag/flash.elf 0 elf
flash write_bank 0 main.bin 0
verify_image main.bin 0 bin
reset run
shutdown

Categories: ARM Projects Tags:

WiFi SMS Gateway

September 5th, 2009 Thomas Jespersen No comments

After a long search on the internet, trying to find a cheap SMS Gateway, I got the idea to create one myself.
As I already had a GM862 module laying around, and I’ve got the WiShield WiFi module for the Arduino too, I thought it would be easy – but it wasn’t!

The hardware setup is pretty easy, except the powering for the GM862, as it requires about 3.8V. That was made with a Linear LT1528 3A low dropout voltage regulator.
After alot of testing and measuring, I finally made a working circuit, and afterwards an Eagle Schematic.

WiFi SMS Gateway - Schematic

WiFi SMS Gateway - Schematic

 

In the following picture you will see the hardware setup, which consists of the Arduino with the WiShield on the top, the GM862 on two breadboards, and alot of wires!

WiFi SMS Gateway - Hardware

WiFi SMS Gateway - Hardware

 

But the real problems appeared when I started programming! I had alot of troubles with the serial connection between the Arduino and the GM862 module, which apparently wasn’t caused by the hardware setup!

 
After alot of debugging I figured it out, and a simple SMS sending code was working :)
Then after a couple of hours I’ve added the WiFi parsing code which sends an SMS to the requested number, with the requested message, read from the GET parameters!

You can grab the code here, and try it out:

/*
* WiFi SMS Gateway sketch by Thomas Jespersen - http://elec.tkjweb.dk/blog
* --- Remeber to change the PIN, if any, in the setup() routine! ---
*/

#include <WiServer.h>

#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,111}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,2,254}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"SSID"}; // max 32 bytes
Read more...

RFID Modded Safe

June 20th, 2009 Thomas Jespersen No comments

This project is about my RFID Modded Safe.

I’ve modded an old electronic toy-safe, which is unlocked by typing the 4-char password.

RFID Modded Safe

RFID Modded Safe

I’ve unsoldered the locking-mechanism from the circuitboard, and connected it to the Arduino instead.

Locking-Mechanism Hack

Locking-Mechanism Hack

Then I connected a ID-20 RFID Reader to the Arduino and programmed it to read the tag, and see if it was allowed to enter the safe.

ID-20 RFID Reader

ID-20 RFID Reader

If it was allowed, the Arduino will keep the safe unlocked in 3 seconds!

I’ve also made this video to show how it works:

You can grab the code here, and try it out:

#include <NewSoftSerial.h>

NewSoftSerial ID12(5,6);
// RX,TX

// RFID reader ID-12 for Arduino
// Based on code by BARRAGAN
// and code from HC Gilje - http://hcgilje.wordpress.com/resources/rfid_id12_tagreader/
// Modified for Arudino by djmatic
// Modified for ID-12 and checksum by Martijn The - http://www.martijnthe.nl/
//
// Use the drawings from HC Gilje to wire up the ID-12.
// Remark: disconnect the rx serial wire to the ID-12 when uploading the sketch
Read more...

Ethernet TV

After my last success with the Serial TV, I’ve got the idea making it possible for you to the television using a browser.

I’m still using my Serial TV, but now it’s connected to an Arduino instead of the computer. The Arduino has an Ethernet Shield on top, and it’s programmed to make a homepage with a text-field and a submit button!

Here is some pictures of the project:

Ethernet TV - Full

Ethernet TV - Full


Ethernet TV - Arduino

Ethernet TV - Arduino


Ethernet TV - iphone

Ethernet TV - iphone


Ethernet TV - iphone + TV

Ethernet TV - iphone + TV


Ethernet TV - Test Text

Ethernet TV - Test Text

Serial PAL TV

Finally I’ve finished my Serial TV project.
It uses a PIC18F4620 running 32 Mhz (8 Mhz crystal + HS PLL), so I’m using the EasyPIC5 for the testing. It is also possible to use other PIC’s, but the available TV Pixel lines will be reduced, caused by the limited RAM.

First I’m going to give alot of the credit to Bruno from Micro-Examples, as I’ve used his PAL TV Code: http://www.micro-examples.com/public/microex-navig/doc/089-pic-pal-tv

Then I’ve wrote some extra code, to make it possible, to write text strings to the television, via a serial communication.

You can download the MikroC project here: Serial TV – MikroC

Here is some pictures of the project:

Serial TV - EasyPIC5

Serial TV - EasyPIC5


Composite Video Resistor Array

Composite Video Resistor Array


Serial TV - Test Text

Serial TV - Test Text

Categories: PIC Projects Tags: , ,

Ethernet DMX

March 25th, 2009 Thomas Jespersen No comments

Last week I recieved the Arduino Ethernet Shield – http://www.arduino.cc/en/Main/ArduinoEthernetShield
There were all ready complete examples provided, so it was very easy to get started.
Then I thought it would be nice to have a Ethernet DMX Controller, so i could type the IP-Adress of the Ethernet Shield in explorer, and from there control my movinghead (Stairville MV250H)

 

Then I found this page showing how to use an MAX485 and the Arduino as a DMX interface – http://iad.projects.zhdk.ch/physicalcomputing/hardware/arduino/dmx-shield-fur-arduino/
I tried it, and it worked :) – And the Arduino could communicate with my movinghead.

 

Then I combined the Ethernet example and the DMX example, to make a HTML Page where i could click on different buttons to change the DMX values that would be sent to my movinghead.
Try it out yourself… You need a MAX485, follow the link above on how to connect it to the Arduino. Just use pin 3 instead of pin 11, as the Ethernet shield uses Pin 9 to 13!

 

Here is the Arduino code:

#include <Ethernet.h>
#include <stdio.h>

// include pin definition library -----------------------------------------------
#include "pins_arduino.h"

// variable definitions ---------------------------------------------------------
int sig = 3; // DMX signal pin - DO NOT CHANGE

// network configuration. gateway and subnet are optional.
byte mac[] = { 0x00, 0x12, 0x34, 0x56, 0x78, 0x90 }; // Change this to the MAC the Ethernet shield should have
byte ip[] = { 192, 168, 1, 1 }; // Change this to the IP-Adress the Ethernet shield should have
Read more...

We are looking for article-writers

January 27th, 2009 Thomas Jespersen No comments

At the moment we are only two adminstrators who also writes the articles.
We would like to have other electronics-interested to write some articles here on the TKJ Electronics blog.

Simon, the other adminstrator has got a Graphical Designer to make us a new layout, which would be published when it’s finished!

But please write a comment to this post if you would like to help us.

SD Card and EEPROM 24FC1025

January 27th, 2009 Thomas Jespersen No comments

Yesterday i started my development with Microchips 24FC1025 EEPROM.
I have successfully connected one 24FC1025 to the PIC16F877A, but i will try and connect 4 of them, which is the maximum.

I’ve also got my SD Card holder soldered so i could use it. I’ve connected the SD Card to the PIC18F452 and made some code in mikroBasic, using their SD library. I’ve successfully made a logging code, and a piture manager.

24FC1025 EEPROM <-> PIC

24FC1025 EEPROM <-> PIC


SD <-> PIC

SD <-> PIC