Hexiware_voltmeter_code_MCP3201_ADC

Committer:
agaikwad
Date:
Wed Mar 22 01:13:04 2017 +0000
Revision:
0:459e9fc6e491
Hexiware_voltmeter_code_MCP3201_ADC

Who changed what in which revision?

UserRevisionLine numberNew contents of line
agaikwad 0:459e9fc6e491 1 # Getting started with Blinky on mbed OS
agaikwad 0:459e9fc6e491 2
agaikwad 0:459e9fc6e491 3 This guide reviews the steps required to get Blinky working on an mbed OS platform.
agaikwad 0:459e9fc6e491 4
agaikwad 0:459e9fc6e491 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
agaikwad 0:459e9fc6e491 6
agaikwad 0:459e9fc6e491 7 ## Import the example application
agaikwad 0:459e9fc6e491 8
agaikwad 0:459e9fc6e491 9 From the command-line, import the example:
agaikwad 0:459e9fc6e491 10
agaikwad 0:459e9fc6e491 11 ```
agaikwad 0:459e9fc6e491 12 mbed import mbed-os-example-blinky
agaikwad 0:459e9fc6e491 13 cd mbed-os-example-blinky
agaikwad 0:459e9fc6e491 14 ```
agaikwad 0:459e9fc6e491 15
agaikwad 0:459e9fc6e491 16 ### Now compile
agaikwad 0:459e9fc6e491 17
agaikwad 0:459e9fc6e491 18 Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
agaikwad 0:459e9fc6e491 19
agaikwad 0:459e9fc6e491 20 ```
agaikwad 0:459e9fc6e491 21 mbed compile -m K64F -t ARM
agaikwad 0:459e9fc6e491 22 ```
agaikwad 0:459e9fc6e491 23
agaikwad 0:459e9fc6e491 24 Your PC may take a few minutes to compile your code. At the end, you see the following result:
agaikwad 0:459e9fc6e491 25
agaikwad 0:459e9fc6e491 26 ```
agaikwad 0:459e9fc6e491 27 [snip]
agaikwad 0:459e9fc6e491 28 +----------------------------+-------+-------+------+
agaikwad 0:459e9fc6e491 29 | Module | .text | .data | .bss |
agaikwad 0:459e9fc6e491 30 +----------------------------+-------+-------+------+
agaikwad 0:459e9fc6e491 31 | Misc | 13939 | 24 | 1372 |
agaikwad 0:459e9fc6e491 32 | core/hal | 16993 | 96 | 296 |
agaikwad 0:459e9fc6e491 33 | core/rtos | 7384 | 92 | 4204 |
agaikwad 0:459e9fc6e491 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
agaikwad 0:459e9fc6e491 35 | frameworks/greentea-client | 1830 | 60 | 44 |
agaikwad 0:459e9fc6e491 36 | frameworks/utest | 2392 | 512 | 292 |
agaikwad 0:459e9fc6e491 37 | Subtotals | 42618 | 784 | 6384 |
agaikwad 0:459e9fc6e491 38 +----------------------------+-------+-------+------+
agaikwad 0:459e9fc6e491 39 Allocated Heap: unknown
agaikwad 0:459e9fc6e491 40 Allocated Stack: unknown
agaikwad 0:459e9fc6e491 41 Total Static RAM memory (data + bss): 7168 bytes
agaikwad 0:459e9fc6e491 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
agaikwad 0:459e9fc6e491 43 Total Flash memory (text + data + misc): 43402 bytes
agaikwad 0:459e9fc6e491 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
agaikwad 0:459e9fc6e491 45 ```
agaikwad 0:459e9fc6e491 46
agaikwad 0:459e9fc6e491 47 ### Program your board
agaikwad 0:459e9fc6e491 48
agaikwad 0:459e9fc6e491 49 1. Connect your mbed device to the computer over USB.
agaikwad 0:459e9fc6e491 50 1. Copy the binary file to the mbed device.
agaikwad 0:459e9fc6e491 51 1. Press the reset button to start the program.
agaikwad 0:459e9fc6e491 52
agaikwad 0:459e9fc6e491 53 The LED on your platform turns on and off.
agaikwad 0:459e9fc6e491 54
agaikwad 0:459e9fc6e491 55 ## Export the project to Keil MDK, and debug your application
agaikwad 0:459e9fc6e491 56
agaikwad 0:459e9fc6e491 57 From the command-line, run the following command:
agaikwad 0:459e9fc6e491 58
agaikwad 0:459e9fc6e491 59 ```
agaikwad 0:459e9fc6e491 60 mbed export -m K64F -i uvision
agaikwad 0:459e9fc6e491 61 ```
agaikwad 0:459e9fc6e491 62
agaikwad 0:459e9fc6e491 63 To debug the application:
agaikwad 0:459e9fc6e491 64
agaikwad 0:459e9fc6e491 65 1. Start uVision.
agaikwad 0:459e9fc6e491 66 1. Import the uVision project generated earlier.
agaikwad 0:459e9fc6e491 67 1. Compile your application, and generate an `.axf` file.
agaikwad 0:459e9fc6e491 68 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
agaikwad 0:459e9fc6e491 69 1. Set breakpoints, and start a debug session.
agaikwad 0:459e9fc6e491 70
agaikwad 0:459e9fc6e491 71 ![Image of uVision](img/uvision.png)
agaikwad 0:459e9fc6e491 72
agaikwad 0:459e9fc6e491 73 ## Troubleshooting
agaikwad 0:459e9fc6e491 74
agaikwad 0:459e9fc6e491 75 1. Make sure `mbed-cli` is working correctly and its version is `>1.0.0`
agaikwad 0:459e9fc6e491 76
agaikwad 0:459e9fc6e491 77 ```
agaikwad 0:459e9fc6e491 78 mbed --version
agaikwad 0:459e9fc6e491 79 ```
agaikwad 0:459e9fc6e491 80
agaikwad 0:459e9fc6e491 81 If not, you can update it:
agaikwad 0:459e9fc6e491 82
agaikwad 0:459e9fc6e491 83 ```
agaikwad 0:459e9fc6e491 84 pip install mbed-cli --upgrade
agaikwad 0:459e9fc6e491 85 ```
agaikwad 0:459e9fc6e491 86
agaikwad 0:459e9fc6e491 87 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32 KB restriction on code size.