Explain how you would modify and test your code

Assignment Help Software Engineering
Reference no: EM131895875

Question 2:

You are a firmware engineer for a large project which is developing a new device which is capable of sorting fruit based on its precise colour.

You are responsible for developing the firmware for the front-end sensor. The only hitch is that the hardware is still under development and the electronics team haven't yet chosen the actual sensor that will he used.

However, they have narrowed it down to two different vendors. The electronics team have however told you that the sensor measures illuminance on three different channels, Red, Green, Blue, each with an 8 bit resolution.

A colour is defined by an <R,G,B> tuple. They have also told you that the sensor will probably be interfaced over an SPI bus.

You have been given a pre-existing driver for the SPI bus, which has one relevant command, defined in Kspi..h>:
/* *
* brief Read from the SPI bus
* CT' param address= register address of SPI slave to read from
* @return= value of register
*/
uint8_t spi_read(uint8_t address);

The electronics team tell you that the Red channel is at address Ox01, Green at address 0)02 and Blue at address Ox03 i.e. if you call spi_read(0%.03) the value that will be returned is the intensity of the blue channel. They also tell you that a status register is found at address OxOO which should return 0x97 if the sensor is configured correctly, and this should probably be checked before reading a value from the colour sensor.

(a) Explain, with the aid of code examples where appropriate, how you would go about writing a driver for the colour sensor_ In particular, explain design decisions made in your API,. for example, how you decide to represent the 3-byte colour information.

(b) Discuss, with the aid of code examples where appropriate, how you would go about testing the colour driver without having the actual sensor to hand. Provide some sample tests that could be used to checkthe colour driver, and also higher level code which depends on the colour sensor.

(c) The electronics team tell you that the blue channel is too sensitive and its value should be divided by 2. Explain how you would modify your code and check that it is working correctly.

(d) The electronics team say they have identified a better sensor that they would like to use in the new version of the product. The only issue is that it communicates over an 12C bus, rather than SPI and the order of the Red and Green channels are swapped. You have a similar driver for the 12C bus which has the prototype:

uint82 i2cread(uint8t address);

Explain how you would modify and test your code such that your colour sensor driver would be able to support either the SPI or the I2C sensor, depending on the product version.

Verified Expert

The task is clear and consistent with full coverage to my knowledge. The assignment was on microprocessor and it’s functioning whether dealing with led lights switches and all. The whole assignment was made in ms word assignment and is totally unique. The assignment was totally genuine with the work and all.

Reference no: EM131895875

Questions Cloud

Interesting special leaf pigmentation : The pollen of a plant with normal green leaves is used to fertilize a plant with interesting special leaf pigmentation.
Journalize the transactions for the seller : Journalize the (3) transactions for the Seller (Turner Company) and the (3) transactions for the buyer (Smith LLC)
What would be the procedures for data collection : Identify one or two research questions based on the rationale.What topics would have to be covered in your literature review?
How womens approaches and behaviors seem to differ from mens : How do women's approaches and behaviors seem to differ from men's, if at all? How does their involvement or behavior seem to differ from male family members?
Explain how you would modify and test your code : Explain how you would modify and test your code such that your colour sensor driver would be able to support either the SPI or the I2C sensor
Role in regulation of transcription of genes : Match each term below with the single most appropriate statement. Each term should be used only once.
What effect will the sales have on aruna tax liability : Assuming she sells both assets in December of year 1 (the current year), what effect will the sales have on Aruna's tax liability
Explanation for the phenotypes of the f1 mice : What is the most likely explanation for the phenotypes of the F1 mice? Are the naked and hairless mutations alleles for the same gene?
What is the impact of telemedicine on quality of health care : What is the impact of Telemedicine on the quality of health care? In breif explain how can Telemedicine be part of the six aims for improvement?

Reviews

inf1895875

5/10/2018 5:36:18 AM

Tomorrow evening is my deadline Just share all the information, for guidance. (questions and solutions for guidance) A good person in Embedded C must not struggle with this question I have got feedback from my tutor- see parts in red in the attached doc. This is better than the first person. 27848521_1Feed back.docx Please ask the expert to clarify these quick questions (1) For 0x03, If the status returned is 0x97 status register is found at address 0x00 -> Why is this not shown in any code snippet example (2) What is this uint16_t *c representing (3) Isn't the colour data supposed to be uint8_t instead of uint16_t, the question highlights 3-byte colour information for the 3 colours? Explain?

inf1895875

5/10/2018 5:26:15 AM

I will pay today 1) No plagiarism or copying stuff online. 2) Need the work 2-4 days time after payment Additional Information; We used the ARM micro-controller for the course. Please see the guidance from question and solutions for the attached work. Please study the attached to have a good idea. 27848597_1Lab 3 uestions.pdf 27848566_2Lab3-SPI Solutions.pdf 27848566_3Set2 answers.pdf One last attachment. Please study these. 27848576_1Set2 questions.pdf My (d) answer he is talking about accelerometer (accel ) not even part of the assignment or question. See this- completely different thing s32 bma2x2_data_readout_template(void) { /*Local variables for reading accel x, y and z data*/ s16 accel_x_s16, accel_y_s16, accel_z_s16 = BMA2x2_INIT_VALUE; /* bma2x2acc_data structure used to read accel xyz data*/ struct bma2x2_accel_data sample_xyz; /* bma2x2acc_data_temp structure used to read accel xyz and temperature data*/ struct ma2x2_accel_data_temp sample_xyzt; /* Local variable used to assign the bandwidth value*

inf1895875

5/2/2018 5:20:54 AM

I will pay today 1) No plagiarism or copying stuff online. 2) Need the work 2-4 days time after payment Additional Information; We used the ARM micro-controller for the course. Please see the guidance from question and solutions for the attached work. Please study the attached to have a good idea. 27848597_1Lab 3 uestions.pdf 27848566_2Lab3-SPI Solutions.pdf 27848566_3Set2 answers.pdf One last attachment. Please study these. 7848576_1Set2 questions.pdf That's the reason I have provided information.

Write a Review

Software Engineering Questions & Answers

  Explain the characteristics of visual studio 2005

Explain the characteristics of Visual Studio 2005.

  Describe the issues central to ensuring quality of software

Minimum number of words 500, referencing with Harvard style and the number of references not less than three Academic Articles or books.

  Describe how the development-process framework provides

Describe how the development-process framework provides opportunities for streamlining software development, increasing quality, and minimizing risk. Explain the distinct focus areas that exist within system engineering and software development.

  What are the different sorting methods

What are the different sorting methods used inside the cascading order?

  Draw associations that are described by the business rules

Draw the associations that are described by the business rules that follow. Include the multiplicities for each relationship. A patient must be assigned to only one doctor, and a doctor can have one or many patients.

  What are the critical responsibilities for the manager

Define information technology and information systems in APA style

  Draw a use case diagram showing six possible use cases

Assume that the Mental care system is being developed using an object-oriented approach. Draw a use case diagram showing at least six possible use cases for this system.

  Currency conversion event

Expand the Currency Conversion event to have a menu of 5-currencies that allows the user to choose which currency they wish to display in its equivalency to the United States dollars.

  Recommend the type of user for which the ipad is best suited

Recommend the type of user for which the iPad is best suited. Recommend the type of user for which the Galaxy Tab is best suited.

  Draw erd to track work orders and tasks of work orders

Draw an ERD. The database should track work orders and tasks of work orders. The following detailed information requirements should be represented by the ERD.

  Data flow diagram for new customer support system

A context diagram, also called a Data Flow Diagram (DFD), documents the scope of the new customer support system. It focuses primarily on output from the system.

  Arithmetic calculator application

Create an application that permits the user to enter a series of numbers and manipulate them. The application should provide users with the option of adding or multiplying numbers.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd