Design, develop and debug a program in C CODE which will read temperatures twice a minute from the temperature sensor (e

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Design, develop and debug a program in C CODE which will read temperatures twice a minute from the temperature sensor (e

Post by answerhappygod »

Design, develop and debug a program in C CODE which will readtemperatures twice a minute from the temperature sensor (every 30seconds) and store them in an array. The array can be a globalvariable and must hold at least 120 temperatures (enough for 1 hourworth of readings). You can use SysTick or one of thetimer/counters to time the 30 seconds between measurements. DO NOTmake 30000 calls to the DelayMS routine to produce a 30 seconddelay – you should produce a 30 second delay with 5 calls or less.The I/O1 user guide and data sheet for the temperature sensor areincluded as pdfs in your home directory. The address of thetemperature sensor is 1001111 binary. The register select addressfor a temperature reading is 0. You can use the factory defaultresolution for your temperature measurements which is 9 bit. Youwill need to read 2 bytes in for each temperature. You can leavethe least significant bits of the low byte at their default valueof 0. Pins PA08 and PA09 are brought out to all the extensionheaders and are logical choices for the I2C lines although you canuse any other appropriate pin. The I2C timing can be handled usinginterrupts or by polling. You may want to add __asm("nop"); to thebody of any empty loops to make debugging easier.
IMPORTANT: It should program on Microchip ATSAMD21J18 Chip.PLEASE HELP!
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply