8051 PIC AVR Arduino Reneasas Peripherals

Wednesday, 24 June 2020

Embedded project development steps

  1. Idea and purpose of the product
  2. Technical specification
  3. Architecture
  4. Component section & design finalization
  5. Test Plan
  6. Design implementation
  7. Prototype Development
  8. Field Trials
  9. Final Product Improvements
  10. Product Release

1. Idea

This is the stage where an idea is discussed with all the stakeholders and brain-stormed to conclude if the idea is worth taking to the development stage.

Market data is collected from online research, interviews with customers, prospects, other people facing market to make a case with two important points:

  • Problems the product will solve. All features of the products could be segmented into urgent needs, good to have and luxury. More you are solving urgent needs better the response from the market would be for the product.
  • The price at which the customer would be willing to pay for solving the problem. The cost of manufacturing & selling the product should be 50% of the actual price to the customer at <1000 units volume as a thumb rule. For higher volumes, the price will be less.

In my opinion, this is one of the most challenging & important tasks in any business i.e to identify the right product which solves the customer’s problem.

2. Detailed Technical Specification

A detailed technical design requirement specification document should be created. Product spec should cover the main things like the purpose of the product, block diagram, main features, environmental conditions, manufacturing requirements, etc.

3. Architecture

After finalizing a detailed technical specification document, it’s time to architect the solution.

On a high level, how the design will look like, what are strategies you will use to build a solution, which type of power supply, which type of wired or wireless connectivity you will use, how the firmware design will look like, Mobile App/PC software/cloud-based application design needs to be decided.

For the hardware design part, this forms the basis for the next step which is selecting the appropriate component for each block or part of the circuit based on various critical parameters like quality, size, features, cost, lead time, EOL, etc.

Here, you need to refine the system level block diagram (Hardware, Software) and add more details to the execution flow using a flow chart for the firmware/software part.

4. Component Selection & Design Finalization

Once the architecture is done, engineers need to look at each block in the system and select the components and finalize the design (application circuit).

An engineer in this stage will decide, for example, a power supply which type of power supply needs to be designed like using a linear regulator or using a DC-DC switching converter or with something else and then which power chip need to used and its application circuit, everything is decided here.

5. Creating a Test Plan

Hardware & Software Testing is very important to check the reliability of the product. Customers pay for the working products and get frustrated with the product which does not meet the expectation or fail in the field.

Companies spend a huge amount of time testing their products so that their customer does not experience any issues. See this video, how mobile is getting tested for hours and days to check it’s reliability.

6. Design Implementation: Hardware, Firmware, software, Enclosure Design

This is the core engineering stage of the implementation. Here the architecture is converted into the design.

For hardware: schematic capture, PCB layout will be done. MCU firmware & if any software is required will be developed. Enclosure design work will also come into this stage.A necessary review system needs to be put in place to ensure first time right is developed. If an external consultant is required for the design reviews, one should not hesitate, most of the time it’s worth the investment.

7. Proof of Concept, Prototype Development & Testing

If the design is completely new or if you don’t have the confidence on the full-design or a part of the design, it is a good idea to build the prototype first to prove the design and while doing so see if there are any issues.

Some times buying readily available block level modules (power supply, MCU, Wireless modules, etc.) and connecting them to form a system, writing a basic firmware and testing in a simulated environment helps gain initial confidence on the design’s performance. This could save a huge amount of money, effort and time otherwise might get wasted if a respin of the design is required due to some issues.

Once this is proven, you can build the prototype and test it again for the functionality & the environmental conditions.

8. Field Trials

You might have heard engineers saying that their product works well in their lab but has issues in the field.

Field conditions are different, engineers need to think through what all conditions their product will go through in the field so that they can reproduce those conditions and check the performance of their product even before sending their product out in the field. Not only field conditions but the user is also different. Engineers need to think of how a layman will handle their product in the field.

9. Final Product Improvements

After field trials are done for several weeks and months, all the improvement needs to be incorporated in the design based on the feedback.

If during field trials some issues are found, you will need to also improve the test procedures you follow during the design validation/ production testing stage to ensure a flawless product comes out of production.

10. Product Launch

Before launching the product, several other things need to be put in place other than the product itself like:

  • Various product certifications based on features it has and the countries it will be sold in.
  • Documentation: Product page on the website, Quick introduction video, Datasheet, User guide, Setting up the Support channel, etc.

Thursday, 28 May 2020

Interview Questions and Answers for Embedded Software Engineer -1


1.       What is difference between RS232 and RS485?

Ans. RS232 is full duplex and RS485 is half duplex. RS232 has RX,TX and GND lines and RS485 has D+ and D- lines for communication. RS232 is used for short distance(15m) and RS485 is used for long distance(1200m). Voltage levels for RS232 is +3V to +15V(logic 0) and -3V to -15V(logic 1).Voltage levels for RS485 is -7V to +12V(difference in two signals is greater than 0.2V then logic1 otherwise logic 0).


2.       What is difference between I2C and SPI ?

Ans.  I2C is two wire protocol(SDA and SCL). SPI is 4 wire protocol (SS,MISO,MOSI,SCK).I2C is half duplex and SPI is full duplex.I2C supports Clock Stretching and SPI does not.Clock stretching is used to slow down speed by holding SCL low.I2C is multimaster communication while SPI is not.I2C is slower(100kbps,400kbps and 3.4Mbps) and SPI is faster(10Mbps). I2C requires more power and SPI requires less power.I2C uses addressing mechanism and SPI uses chip select mechanism.

3.       What does static keyword used for?

Ans. Static variables have property of preserving their value after they are out of their scope.They is initialized only once and exist till termination of program. Static variables are allocated memory in data segment not in stack segment. Static variables should not declared inside structure. The reason is C Compiler required entire structure elements to be placed together because memory allocation for structure should be contiguous.

4.       What does volatile is in C?

Ans.  Volatile is qualifier used for omitting variable from optimization.It tells compiler that variable may change at any time during execution.

5.       What are storage classes in C and explain?

Ans. Auto, Static, Extern, register.


MQTT implementation using GSM module


A]AT commands for MQTT broker connection
1)AT:Used to check the interaction between the computer and the module. This command is usually replied with an OK if the port and the module can connect correctly, else wise it comes back with a result code ERROR.
2)AT+CIPMODE: Used for selecting TCPIP application mode. '0' non-transparent mode and '1' is transparent mode. In this mode we don’t need to type CIPSEND again and again to send the packet
3)AT+CSTT: Sets up the apn, user name and password for the PDP (Packet Data Protocol) context.
4)AT+CIICR: This command brings up the GPRS or CSD call depending on the configuration previously set by the AT+CSTT command.
5)AT+CIFSR: The command returns the local IP address. It is imperative the the PDP context must have been activated before to get the IP address.
6)AT+CIPSTART: Starts a TCP or UDP connection.
7)AT+CIPSHUT: Will close the GPRS PDP context.

STEPS:
1] AT
2] AT+CIPMODE=1
3] AT+CSTT=” WWW”,””,””
4] AT+CIICR
5] AT+CIFSR
6] AT+CIPSTART="TCP","m13.cloudmqtt.com","13494"
7] AT+CIPSHUT
B]MQTT packet formation:
Packet structure is given is excel sheet.
·         Abbreviations:

1)CONN=Connect packet
2)PUB=Publish packet
3)SUB=Subscriber packet
4)RL=Remaining length
5)PLEN=Protocol length
6)LVL=Level
7)FL=Flag length
8)CIDLEN=Client ID length
9)ULEN=Username length