Thursday, September 7, 2017

Embedded C

Embedded C

The General Term for Programming a Microcontroller or Embedded Device using ‘C’ programming language syntax is called Embedded C

Why and what is its convenience?
 The native Programming language for a Microcontroller is it’s Assembly instructions. It varies from Controller to controller and we Have to learn it’s own instructions to program each type. But if we use a Software tool called C cross Compiler for that particular Microcontroller we can program It using  C language syntax C is the most popular general purpose high level language mostly used for system level programming High level language means the capability to use  single consolidated statements to represent, many separate steps involved for commanding a processor to execute a task For example in C we can write if(Var1>var2) but in PIC Micro assembly we can’t do it Arbitrary memory address access and pointer arithmetic is an important feature that makes C a perfect fit for

INTRODUCTON TO C LANGUAGE

C is a structure oriented programming language used for developing system applications that forms a major portion of operating systems such as Windows, UNIX  and Linux The main advantage of C is that system management like operations more convenient in C because direct memory access which is a basic requirement when we deal with low level hardware C language is gradually replacing (or almost replaced, at least in some controllers) assembly language in many embedded applications because it has several advantages over native assembly language. The importance and convenience is so high that latest  microcontroller Architectures are designed to be specified as C friendly which means the instructions are prepared with a view that programming will be written in C  The most important one is that it allows us to work on the program logic at a level higher than the assembly  language; thus, programming productivity is greatly improved.

Friday, September 23, 2016

How to change baud rate of ESP8266 to 9600

ESP8266





                                                         The ESP8266 WiFi Module is a self contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor. Each ESP8266 module comes pre-programmed with an AT command set firmware, meaning, you can simply hook this up to your Arduino device and get about as much WiFi-ability as a WiFi Shield offers (and that’s just out of the box)! The ESP8266 module is an extremely cost effective board with a huge, and ever growing, community.
This module has a powerful enough on-board processing and storage capability that allows it to be integrated with the sensors and other application specific devices through its GPIOs with minimal development up-front and minimal loading during runtime. Its high degree of on-chip integration allows for minimal external circuitry, including the front-end module, is designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP applications and Bluetooth co-existance interfaces, it contains a self-calibrated RF allowing it to work under all operating conditions, and requires no external RF parts.
There is an almost limitless fountain of information available for the ESP8266, all of which has been provided by amazing community support. In the Documents section below you will find many resources to aid you in using the ESP8266, even instructions on how to transforming this module into an IoT (Internet of Things) solution!


SET DEFAULT BAUD RATE TO 9600

    Must update firmware to version V0.9.2.2,  in this version defalt baud rate is 9600
    you can download firmware here   Download Firmware

    Esp Flasher download here   ESP Flasher Download

CONNECTION FOR FIRMWARE FLASH





  • Now let’s flash some firmware:
  • Ground GPIO0 and start-up or reset device.
  • You should see the blue LED flash once.
  • Run the executable “esp8266_flasher.exe” that was just downloaded.
  • Click the “Bin” button to select the downloaded firmware (ESP_8266_BIN0.22.bin).
  • Enter the COMx number assigned to your serial port (mine was 7).
  • Click “download.
  • When the download finishes, you will see “Failed to leave Flash mode”
  • Ignore this and close the downloader program.
  • Remove the GPIO0 to ground connection.
  • Reset the ESP8266: You will see two blue flashes again (the second flash is dimmer than the first).
  • The firmware is running at 115200 now and should respond to AT commands.
  • The most basic command to verify the firmware:
  • Enter “AT<enter>”
  • ESP8266 response: OK