Tags:
view all tags
%DASHBOARD{ section="dashboard_start" }% %DASHBOARD{ section="banner" image="%PUBURLPATH%/Velo/MainMCUFirmware/kinetisdesignstudio.png" title="Main MCU Firmware" titlestyle="color:#F00000;" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Firmware for the Velo Bling-Bling project LED lights for bicycle wheels. 16 multi color LEDs on each side (PCB top- and bottom side). There are two windows (upper and lower) on each side for display dynamic information like speed, trip time, trip distance, etc. or static information like strings and images. The windows have a resolution of 100 x 16 pixels. The space between the windows can be filled with a pattern/image (AKA blingbling). Target system is a proprietary PCB (eWheel32 V1.4 an newer) with a [[MainMCUFirmware#MCU_MK22DX256VLF5][MK22DX256VLF5]] MCU from Freescale/NXP. The PCB is free hardware, see ElectronicDesign and [[https://github.com/spyren/veloblingbling-pcb][GitHub]] There is also an optional Bluetooth Low Energy (Smart) subsystem on board. It is a LAIRD BL600-SA module. The [[BluetoothApplication][Bluetooth application software]] is on [[https://github.com/spyren/veloblingbling-ble][GitHub]] too. It is possible to mount the PCB direct onto the wheel spokes but it is better to use a mounting frame. This frame can be ordered from http://shapeways.com or you can print it by yourself on 3D printer. See FrameDesign and [[https://github.com/spyren/veloblingbling-frame][GitHub]] ---++ Copyright Peter Schmid, Switzerland, peter@spyr.ch This file is part of "Velo Bling-Bling" main MCU firmware. "Velo Bling-Bling" firmware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. "Velo Bling-Bling" is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with "Velo Bling-Bling". If not, see http://www.gnu.org/licenses/. %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Tools ---++ Kinetis Design Studio Integrated Development Environment (IDE) The [[http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/ides-for-kinetis-mcus/kinetis-design-studio-integrated-development-environment-ide:KDS_IDE][Kinetis Design Studio (KDS)]] is a complimentary integrated development environment for Kinetis MCUs that enables robust editing, compiling and debugging of your designs. Based on free, open-source software including Eclipse, GNU Compiler Collection (GCC), GNU Debugger (GDB), and others, the Kinetis Design Studio IDE offers designers a simple development tool with no code-size limitations. You have to use an old Version (2.0.0, current is 3.2.0) for the veloblingbling project because the Processor Expert USB Stack does not work with newer Kinetis Design Studio Integrated Development Environment. ---++ Processor Expert Software and Embedded Components [[http://www.nxp.com/products/software-and-tools/software-development-tools/processor-expert-and-embedded-components][Processor Expert Software]] is a development system to create, configure, optimize, migrate, and deliver software components that generate source code for our (Freescale/NXP) silicon. Unfortunately the Processor Expert _USB Stack v4.1.1 NXP bare metal (no OS) USB Stack_ is no longer supported. But you can still find it under [[http://www.nxp.com/products/automotive-products/microcontrollers-and-processors/8-bit-s08-5.5v-mcus/usb-stack:MEDICALUSB][(ARCHIVED) USB Stack]]. You need a Windows PC to install, but the Processor Expert components can be used for Linux boxes too, the PEupd files are in the directory =C:\Freescale\Freescale USB Stack v4.1.1\ProcessorExpert\Components= and have to be imported into the KDS IDE: Processor Expert -> Import Components. I will migrate the Velo Bling-Bling USB software from Freescale USB Stack v4.1.1 to Erich Styger's USB Stack. ---++ Debug Adapter The KDS supports following adapters (protocols): * [[http://www.pemicro.com/opensda/][OpenSDA]] Serial and Debug Adapter (proprietary Freescale/NXP/P&E Microcomputer Systems) * [[https://www.segger.com/][Segger]] (industrial standard) * [[http://openocd.org/][OpenOCD]], I propose to use a Freescale/NXP Freedom Board e.g. [[http://www.nxp.com/products/software-and-tools/hardware-development-tools/freedom-development-boards/freescale-freedom-development-platform-for-kinetis-k22-mcus:FRDM-K22F][FRDM-K22F]] as a debug adapter. I use the !OpenOCD/CMSIS-DAP/mbed-interface protocol (factory set on FRDM-K22F). Quote from _Freedom Board for Kinetis !K22F Hardware (FRDM-K22F), Users Guide_ <blockquote> *3.2.1 Debug interface* Signals with SPI and GPIO capability are used to connect directly to the SWD of the !K22F. These signals are also brought out to a standard 10-pin (0.05) Cortex debug connector (J11). It is possible to isolate the !K22F MCU from the !OpenSDAv2 circuit and use J11 to connect to an off-board MCU. To accomplish this, cut the trace on the bottom side of the PCB that connects J7 pin 2 to J11 pin 4. This will disconnect the SWD_CLK pin to the !K22F so that it will not interfere with communication to an off-board MCU connected to J7. The J11 header is populated by default. A mating cable, such as a Samtec FFSD IDC cable, can then be used to connect from the !OpenSDAv2 of the FRDM-K22F to an off-board SWD connector. </blockquote> You can still use the FRDM-K22F as a prototype board. You should solder a pinheader and plug a jumper if you want to use the FRDM-K22F as a prototype board. See also an excellent introduction to [[https://mcuoneclipse.com/2015/03/22/openocdcmsis-dap-debugging-with-eclipse-and-without-an-ide/][OpenOCD/CMSIS-DAP Debugging]] by Erich Styger. %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Get the Software and Import the Project into the IDE ---++ Get the Source from the Repository The Velo Bling-Bling Kinetis project is on the !GitHub repository https://github.com/spyren/veloblingbling-mcu. Download the [[https://github.com/spyren/veloblingbling-mcu/archive/master.zip][ZIP-File]] and unzip it or better [[https://help.github.com/articles/cloning-a-repository/][clone the repository]] e.g. for GNU/Linux: <pre> psi@homer:~/veloblingbling/mcu> <b>git clone https://github.com/spyren/veloblingbling-mcu</b> Klone nach 'veloblingbling-mcu' ... remote: Counting objects: 265, done. remote: Compressing objects: 100% (97/97), done. remote: Total 265 (delta 167), reused 260 (delta 166), pack-reused 0 Empfange Objekte: 100% (265/265), 223.50 KiB | 0 bytes/s, Fertig. Löse Unterschiede auf: 100% (167/167), Fertig. Prüfe Konnektivität ... Fertig. psi@homer:~/veloblingbling/mcu> </pre> ---++ Import the Project into the IDE File -> Import -> General -> Existing Projects into Workspace -> <br> Select root directory<br> Copy project into workspace<br> Browse to =veloblingbling/mcu= directory<br> Finish I don't know why, but I had to change the Processor Expert system directory: <br> Window -> Preferences -> Processor Expert -> Paths <br> system directory =/opt/Freescale/KDS_2.0.0/eclipse/ProcessorExpert= %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ MCU MK22DX256VLF5 * Data sheets * [[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=K22_50][K22_50: Next-Generation Kinetis K22 USB 50 MHz MCUs]] * [[http://cache.freescale.com/files/32bit/doc/data_sheet/K22P48M50SF4.pdf][MK22DX256VLF5 Data Sheet]] 48 Pin * [[http://cache.freescale.com/files/32bit/doc/ref_manual/K22P48M50SF4RM.pdf][K22 Sub-Family Reference Manual]] !MK22DX128VLF5, !MK22DX256VLF5 * Features * Core ARM Cortex M4, 50 MHz * Run mode current 17 mA, wait 8 mA * A/D Converter - Bits (bit) 16 * Additional Features Vref * Ambient Operating Temperature (Min-Max) (°C) -40 to 105 * Analog Comparator 2 * Cache (kB) 0 * Debug Features JTAG, Serial Wire Debug, cJTAG * EEPROM (kB) 4 * External Bus Interface n/a * [[http://cache.freescale.com/files/32bit/doc/app_note/AN4282.pdf][FlexMemory]] (KB) 64 * I/O Pins 29 * Independent ADC modules 1 * Internal Flash (kB) 256 * Internal RAM (kB) 32 * Max Simultaneous ADC channels 1 DP14 SE * Pulse Width Modulators - Channels 10 * Sample Exception Availability Y * Serial Interface - Number of Interfaces 4 * Serial Interface - Type UART, SPI, I2C, I2S * USB OTG LS/FS * Supply Voltage (Min-Max) (V) 1.71 to 3.6 * Timer type Low Power Timer, Periodic Interrupt Timer, Programmable Delay Block * Total DMA Channels 16 * Total Flash memory (kB) 320 * LQFP-48 The !MK20DX128VLF5 can also be used, but the memory footprint (Flash and RAM) has to be reduced. The !MKL27Z256VFT4 would be an excellent alternative (build-in bootloader, 8 mA run mode current with peripherals, 4 mA wait mode current), but the case is QFN48 and therefore you have to change the PCB layout. %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="dashboard_end" }% -- %USERSIG{PeterSchmid - 2016-03-30}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
kinetisdesignstudio.png
r1
manage
71.8 K
2016-03-30 - 20:27
PeterSchmid
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r13
<
r12
<
r11
<
r10
<
r9
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r11 - 2016-05-24
-
PeterSchmid
Home
Site map
Cosmac web
MRR web
MecrispCube web
SuperRandonnee web
TWiki web
Ursula web
Velo web
Velo Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Edit
Attach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback