1 / 25

Figure 9.1. A block diagram of a microwave oven

Figure 9.1. A block diagram of a microwave oven. Figure 9.2. A simplified block diagram of a digital camera. Please see “ portrait orientation ” PowerPoint file for Chapter 7. Figure 9.6. Parallel interface registers. Figure 9.7. Receive and transmit structure of the serial interface.

rufin
Download Presentation

Figure 9.1. A block diagram of a microwave oven

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Figure 9.1. A block diagram of a microwave oven

  2. Figure 9.2. A simplified block diagram of a digital camera.

  3. Please see “portrait orientation” PowerPoint file for Chapter 7 Figure 9.6. Parallel interface registers.

  4. Figure 9.7. Receive and transmit structure of the serial interface.

  5. RBUF EQU $FFFFFFE0 Receiv e buffer. SST A T EQU $FFFFFFE2 Status register for serial in terface. P A OUT EQU $FFFFFFF1 P ort A output data. P ADIR EQU $FFFFFFF2 P ort A direction register. * Initialization ORIGIN $1000 Mo v eByte #$FF,P ADIR Configure P ort A as output. * T ransfer the c haracters LOOP T estbit #0,SST A T Chec k if new c haracter is ready . Branc h=0 LOOP Mo v eByte RBUF,P A OUT T ransfer a c haracter to P ort A. Branc h LOOP Figure 9.10. A generic assembly language program for character transfer using polling.

  6. /* Define register addresses */ #define RBUF (v olatile c har *) 0xFFFFFFE0 #define SST A T (v olatile c har *) 0xFFFFFFE2 #define P A OUT (c har *) 0xFFFFFFF1 #define P ADIR (c har *) 0xFFFFFFF2 v oid main() { /* Initialize the parallel p ort */ *P ADIR = 0xFF; /* Configure P ort A as output */ /* T ransfer the c haracters */ while (1) { /* Infinite lo op */ while ((*SST A T & 0x1) = = 0); /* W ait for a new c haracter */ *P A OUT = *RBUF; /* Mo v e the c haracter to P ort A */ } } Figure 9.11. C program for character transfer using polling.

  7. /* Define register addresses */ v olatile c har *RBUF = (c har *) 0xFFFFFFE0; v olatile c har *SST A T = (c har *) 0xFFFFFFE2; c har *P A OUT = (c har *) 0xFFFFFFF1; c har *P ADIR = (c har *) 0xFFFFFFF2; v oid main() { /* Initialize the parallel p ort */ *P ADIR = 0xFF; /* Configure P ort A as output */ /* T ransfer the c haracters */ while (1) { /* Infinite lo op */ while ((*SST A T & 0x1) = = 0); /* W ait for a new c haracter */ *P A OUT = *RBUF; /* Mo v e the c haracter to P ort A */ } } Figure 9.12. An alternative C program for character transfer using polling.

  8. Mo v e P ADIR,R0 Mo v eByte #$FF,(R0) LOOP Mo v e SST A T,R0 T estbit #0,(R0) Branc h=0 LOOP Mo v e RBUF,R0 Mo v e P A OUT,R1 Mo v e (R0),(R1) Branc h LOOP Figure 9.13. Possible compiled code for the program segment in Figure 9.12.

  9. RBUF EQU $FFFFFFE0 Receiv e buffer. SCONT EQU $FFFFFFE3 Con trol register for serial in terface. P A OUT EQU $FFFFFFF1 P ort A output data. P ADIR EQU $FFFFFFF2 P ort A direction register. * Initialization ORIGIN $1000 Mo v eByte #$FF,P ADIR Configure P ort A as output. Mo v e #INTSER V,$24 Set the in terrupt v ector. Mo v e #$40,PSR Pro cessor resp onds to IR Q in terrupts. Mo v eByte #$10,SCONT Enable receiv er in terrupts. * T ransfer lo op LOOP Branc h LOOP Infinite w ait lo op. * In terrupt service routine INTSER V Mo v eByte RBUF,P A OUT T ransfer a c haracter to P ort A. ReturnI Return from in terrupt. Figure 9.14. A generic assembly language program for character transfer using interrupts.

  10. #define RBU (v olatile c har *) 0xFFFFFFE0 #define P A OUT (c har *) 0xFFFFFFF1 . . . v oid main() { . . . } v oid in tserv() { *P A OUT = *RBUF; /* Mo v e a c haracter to P ort A */ } Figure 9.15. A function call in a C program.

  11. Please see “portrait orientation” PowerPoint file for Chapter 7 Figure 9.16. C program for character transfer using interrupts.

  12. Please see “portrait orientation” PowerPoint file for Chapter 7 Figure 9.17. C program for transfer through a circular buffer.

  13. Please see “portrait orientation” PowerPoint file for Chapter 7 Figure 9.18. A generic assembly language program for transfer through a circular buffer.

  14. Please see “portrait orientation” PowerPoint file for Chapter 7 Page 1 of Figure 9.20. C program for the reaction timer.

  15. Please see “portrait orientation” PowerPoint file for Chapter 7 Page 2 of Figure 9.20. C program for the reaction timer.

  16. Please see “portrait orientation” PowerPoint file for Chapter 7 Page 1 of Figure 9.21. Assembly language program for the reaction timer using polling.

  17. Please see “portrait orientation” PowerPoint file for Chapter 7 Page 2 of Figure 9.21. Assembly language program for the reaction timer using polling.

More Related