Monday, September 29, 2014

ARM and STM32 Abbreviations


  If you are new to STM32 microcontroller or programming, while reading datasheets you are going to encounter a lot of terms or abbreviations that you don't know.

  I wanted to make a list for most of the terms and their abbreviations/descriptions. I'm going to update the list, feel free to offer additions.



A/D Converter: Analog Digital Converter
ADC : Analog Digital Converter
AHB : Advanced High Performance Bus
APB : Advanced Peripheral Bus
ART Accelator : Adaptive Real Time Accelator
B: Dedicated to BOOT0 Pin (Pin Abbreviation)
BCD : Binary Coded Decimal 
BGA : Ball Grid Array 
BJT : Bipolar Junction Transistor
BOR : Brownout Reset
BQFP : Bumpered Quad Flat Package
CAN : Controller Area Network
CF : Compact Flash
CMOS : Complementary Metal Oxide Semiconductor
CQFP : Ceramic Quad Flat Package   
CRC : Cyclic Redundancy Check 
CTS : Clear to Send
D/A Converter : Digital Analog Converter
DAC : Digital Analog Converter
DCE : Data Communication Equipment
DCMI : Digital Camera Interface 
DFU : Device Firmware Upgrade
DMA : Direct Memory Access
DMIPS : Dhrystone Million Instructions Per Second
DSP : Digital Signal Processing
DTE : Data Terminal Equipment
EMI : Electromagnetic Interference
EMS : Electromagnetic Susceptibility
ESD : Electrostatic Discharge
ESR : Equivalent Series Resistance
ETM : Embedded Trace Macrocell
EXTI : External Interrupt
FET : Field Effect Transistor
FIFO : First In, First Out 
FM+ : Fast Mode Plus (Pin Abbreviation)
FPGA : Field Programmable Gate Array
FPU : Floating Point Unit
FPU : Floating Point Unit 
FSMC : Flexible Static Memory Controller
FT : 5V Tolerant Input Output Pin (Pin Abbreviation)
FTB : Fast Transient Burst (Voltage)
FTf : 5V Tolerant Input Output Pin with FM+ capable (Pin Abbreviation)
GPIO : General Purpose Input Output
HSE : High Speed External (Oscillator/Clock)
HSI : High Speed Internal (Oscillator/Clock)
HVAC : Heating Ventilating and Air Conditioning
I : Input Only Pin (Pin Abbreviation)
I/O : Input Output Pin (Pin Abbreviation)
I/O : Input/Output 
I2C : Inter Integrated Circuit, aka I squared C
I2S : Inter-IC Sound, Integrated Interchip Sound
IC : Input Capture
IC : Integrated Circuit
IRDA : Infrared Data Association
IWDG : Independent Watch Dog
JTAG : Joint Test Action Group
LAN : Local Area Network
LIN : Local Interconnect Network 
LPR : Low Power Regulator 
LQFP : Low Profile Quad Flat Package
LSE : Low Speed External (Oscillator/Clock)
LSI : Low Speed Internal (Oscillator/Clock)
MAC : Media Access Control (Address)
MCU : Micro Controller Unit
MII : Media Independent Interface
MIPS : Microprocessor without Interlocked Pipeline Stages
MIPS : Million Instructions Per Second 
MISO : Master Input Slave Output (Serial Peripheral Interface Bus Abbreviation)
MMC : Multi Media Card
MOSI : Master Output Slave In (Serial Peripheral Interface Bus Abbreviation)
MPU : Memory Protection Unit
MR : Main Regulator
MSPS : Mega Sample Per Second
NC : Normally Closed 
NC : Not Connected
NO : Normally Open
NRST : nRESET (Pin)
NVIC : Nested Vectored Interrupt Controller
OC : Output Compare
PDR : Power Down Reset
PHY : Physical (Layer)
PLC : Programmable Logic Controller
PLL : Phase Locked Loop
PM Bus : Power Management Bus
POR : Power On Reset
PPB : Private Peripheral Bus
PVD : Programmable Voltage Detector
PWM : Pulse Width Modulation 
QFP :  Quad Flat Package
RAM : Random Access Memory 
RC : Resistor Capacitor
RMII : Reduced Media Independent Interface
RNG : Random Number Generator
RST : Bidirectional Reset Pin With Embedded Weak Pull Up Resistor 
RTC : Real Time Clock
RTS : Request to Send
RTR : Ready to Receive
S : Supply Pin (Pin Abbreviation)
SCL : Serial Clock Line
SCLK : Serial Clock (Serial Peripheral Interface Bus Abbreviation)
SDA : Serial Data Line
SDIO : Secure Digital Input Output
SM Bus : System Management Bus
SMI : Serial Management Interface
SPI : Serial Peripheral Interface 
SRAM : Static Random Access Memory
SS : Slave Select (Serial Peripheral Interface Bus Abbreviation)
SSCG : Spread Spectrum Clock Generation
SWD : Serial Wire Debug
TC: Standartd 3.3V Input Output Pin (Pin Abbreviation)
TIM : Timer
TPA : Trace Port Analyzer
TPIU : Trace Port Interface Unit 
TQFP : Thin Quad Flat Package
TTa : 3.3V Tolerant Input Output Pin Directly Connected to ADC (Pin Abbreviation)
UART : Universal Asynchronous Receiver Transmitter
ULPI : Utmi Low Pin Interface
USART : Universal Synchronous Asynchronous Receiver Transmitter
USB OTG : USB On The Go
UTMI : USB 2.0 Transceiver Macrocell Interface
VBAT : Battery Voltage Supply (Pin)
VCC :  Positive Supply Voltage (BJT)
VDD : Positive Supply Voltage (FET)
VEE : Negative Supply (Ground) (BJT)
VSS : Negative Supply (Ground) (FET)
WWDG : Windows Watch Dog


Saturday, September 27, 2014

STM32 Software Development Tools

   After deciding which microcontroller should i choose,  next question is what should I use to develop on STM32. You should select a development platform for your MCU (Microcontroller Unit). There are multiple choices :

1) KEIL MKD-ARM

   In my blog, i am going to use KEIL uVision and ST Standart Peripheral Library. KEIL MDK-ARM Microcontroller Devolopment Kit is not free unfortunately. But luckily it is fully functional up to 32KB projects.

32KB is fair enough for test applications. µVision (i will say uVision later) is a great IDE for development and debugging. It supoorts intellisense like feature called autocomplete.

Multiproject workspace feature allows simultaneous projects in the same environment. Advanced debug feature allows easy and detailed debugging sessions. 

KEIL supports latest ARM Cortex M7 processor. You can download from the below link :

http://www.keil.com/arm/mdk.asp




2) IAR EMBEDDED WORKBENCH FOR ARM



   IAR is an another successful compiler/debugger for ARM architecture. It also supports latest ARM Cortex M7 processors.

   It also integrates C-Run. C-Run is a runtime analysis add on. Buffer overflow detection, detection of value changes while casting operations are some of the features.


Unfortunately IAR is not free also. But you have two options :

a) Time Limited Version : You can use IAR for 30Days with full functionality, you can not use for commercial applications.

b) Size Limited Version : Your code is limited to 32KB,  no MISRA C support, no power debug support, runtime libraries are not included.

Yes i know a third option also ;)

You can download IAR from below :

http://www.iar.com/Service-Center/Downloads/




3) HITEX (HiTOP FOR CORTEX)

    HiTOP is another development platform for Cortex M processors. This one has also code size and time limitation.



Personally i haven't tried yet, you can check from the below link :

http://www.hitex.com/index.php?id=download-hitop540&L=%255C%255C%255C%2527241

Link changes according to version, if the above link is broken then go to hitex web site's download section :

http://www.hitex.com




4) ATOLLIC (TRUESTUDIO FOR ARM)

    Atollic TrueStudio is a compiler and debugger for ARM. Importing Eclipse IDE and GNU Toolchain projects are supported.


You have to pay for good ones, 30 day evaluation version is avaliable, check the link below :

http://atollic.com/index.php/truestudio





5) RAINSONANCE (RKit-ARM)

    RKit-Arm is a compiler, debugger and editor package for ARM. It has an IDE (Integrated Development Environment) called Ride7.

   As always this one is not free also. But you can use for 30 Day in evaluation mode. Check the links below for details :

http://www.raisonance.com/
http://www.raisonance.com/ride7.html




6) MIKROELEKTRONIKA (mikroC, mikroBASIC, mikroPASCAL for ARM)

    MikroElektronika has it's own libraries for popular devices like touch control chips, lcd libraries, sd/mmc card libraries etc and wide example projects.

   You can use three different products : mikroC, mikroBASIC or mikroPASCAL. Costs about $250 to $300, free versions are fully functional but has a funny 8KB code limit.

meh, 8KB code limit is funny for arm. You can check mikroelektronika web page :

http://www.mikroe.com/arm/compilers/




7) CODE::BLOCKS

    Code::Blocks is a free IDE for C and C++. For using STM32 development you have to install an external debugger plugin called Embedded Plugin Suite (EPS)


    Code::Blocks IDE is free but EPS costs about €120 per series, ie if you want STM32F1 and STM32F4 support you have to pay €240.

Code::Blocks web site :

http://www.codeblocks.org/

Embedded Plugin Suite web site : 

http://www.comsytec.eu/

 

 8) CooCox CoIDE

    You are not going to believe me but it is free ! CooCox has integrated CoBuilder and CoDebugger features. 


Another good side is you can use CoOS, a free open source RTOS (Real Time Operating System). Give it a try, here is the link :

http://www.coocox.org



 9) ECLIPSE IDE

   Eclipse IDE is not enough for embedded programming alone but with a few tools, you can develop for free. What you need is a compiler, debugger and maybe a RTOS.




   You can use GCC (GNU Compiler Collection) for free. For debugging purposes you can use Open OCD (Open On Chip Debugger), and it is free also. If you need a RTOS then freeRTOS is a good choice.

So Eclipse IDE + GCC + Open OCD + FreeRTOS is a killer combo.

And here is the GNU ARM Eclipse Plugins :

http://sourceforge.net/projects/gnuarmeclipse/




 10) MIOSIX
 
  For using Miosix you will need a computer running on Linux. I hope they release Windows version also because it has mxgui, you can get real time 3D renders really fast.
Miosix uses Netbeans IDE. But Netbeans is not supporting Miosix, you have to configure it for yourself.

For instructions an downloads here is the Miosix web page link :

http://miosix.org



Monday, September 22, 2014

Which microcontroller should i choose ?

STM (STMicroelectronics)  offers wide range of microcontrollers but which one you should choose?  You should consider some basic parameters.



1) Flash Memory

This is where your programs are stored. For STM32 series microcontrollers typically it varies between 128KB to 2MB.

2) RAM

RAM sizes in microcontrollers aren't that big compared to computers. They are typically in KB range. 64KB to 256KB is common for STM32 series

3) FREQUENCY

In modern CPUs frequencies are measured in GHz but if you are not using Cortex A series your frequency range is measured in MHz. For example STM32F407 runs at 168Mhz.

4) PERIPHERALS and INTERFACES

Which peripherals and interfaces do you need for your project ?

ADC (Analog to Digital Converter)
CAN (Controller Area Network)
DAC ( Digital to Analog Converter)
DCMI (Digital Camera Interface)
DMA (Direct Memory Access)
FSMC (Flexible Static Memory Controller)
I2C (Inter Integrated Circuit aka I squared C)
SDIO (Secure Digital Input Output)
SPI (Serial Peripheral Interface)
TIMER (Hardware Timers)
UART/USART (Universal Asyncronous Receiver Transmitter/Universal Syncronous Asyncronous Receiver Transmitter)

5) PRICE

This is not your concern if you are a hobbyist or only prototyping. But if you are planning to manufacture your design 1000+ quantities, you should consider prices.

If STM32F1 is enough for your project than using STM32F4 costs you a lot of money.


You can use ST-MCU-FINDER application. Supports IOS, Android and Windows platforms



http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF260223