1. Extend Example 7-26 to convert 10 packed BCD numbers stored in an array to unpacked BCD numbers and display on Port C

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Extend Example 7-26 to convert 10 packed BCD numbers stored in an array to unpacked BCD numbers and display on Port C

Post by answerhappygod »

1 Extend Example 7 26 To Convert 10 Packed Bcd Numbers Stored In An Array To Unpacked Bcd Numbers And Display On Port C 1
1 Extend Example 7 26 To Convert 10 Packed Bcd Numbers Stored In An Array To Unpacked Bcd Numbers And Display On Port C 1 (24.84 KiB) Viewed 43 times
1 Extend Example 7 26 To Convert 10 Packed Bcd Numbers Stored In An Array To Unpacked Bcd Numbers And Display On Port C 2
1 Extend Example 7 26 To Convert 10 Packed Bcd Numbers Stored In An Array To Unpacked Bcd Numbers And Display On Port C 2 (41.64 KiB) Viewed 43 times
1 Extend Example 7 26 To Convert 10 Packed Bcd Numbers Stored In An Array To Unpacked Bcd Numbers And Display On Port C 3
1 Extend Example 7 26 To Convert 10 Packed Bcd Numbers Stored In An Array To Unpacked Bcd Numbers And Display On Port C 3 (41.64 KiB) Viewed 43 times
1. Extend Example 7-26 to convert 10 packed BCD numbers stored in an array to unpacked BCD numbers and display on Port Cand Port D, respectively. The array of packed BCD numbers is given below: PACKED_BCD [1] = {0x12, 0x23, 0x34, Ox45, Ox56, 0x67. Ox78, 0x89. 0x90,0x01),

Example 7-26 Write an AVR C program to convert packed BCD 0x29 to ASCII and display the bytes on PORTB and PORTC. Solution: //standard AVR header #include <avr/io.h> int main(void) unsigned char x,y: unsigned char mybyte 0x29; DDRB = DDRC - OxFF; Xmybyte & Ox0F; PORTB X I 0x30; y = mybyte & OxF0; Y y >> 4; PORTC= y 10x30; //make Ports B and C output //mask upper 4 bits W/make it ASCII //mask lower 4 bits //shift it to lower 4 bits //make it ASCII return 0; 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply