ex1 - digsys.upc.esdigsys.upc.es/.../ex/ex5/sdr_curs_09-10_q2_ex5.docx  · web view1.10.8. uart9....

13
EX5: Designing a microcontroller-based one minute timer EX 5 DIGITAL RECONFIGURABLE SYSTEMS A one minute timer 1.1 Cooperative group TEAM NUMBER: ___________ DUE DATE: ________________ 1 st review due date: ________________ STUDY TIME: Study time (in hours) Group work Classroom and laboratory sessions Sessions out of classroom Individu al Student 1 Student 2 Student 3 STATEMENT: My signature below indicates that I have (1) made equitable contribution to EX 5 as a member of the group, (2) read and fully agree with the contents (i.e., results, conclusions, analyses, simulations) of this document, and (3) acknowledged by name anyone outside this group who assisted this learning team or any individual member in the completion of this document. Today’s date: __________________ Active members Roles: (reporter, simulator, etc.) (1) ________________________________________ _______________ 1

Upload: truongxuyen

Post on 18-Jan-2019

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EX5: Designing a microcontroller-based one minute timer

EX 5 DIGITAL RECONFIGURABLE SYSTEMS

A one minute timer

1.1 Cooperative groupTEAM NUMBER: ___________

DUE DATE: ________________ 1st review due date: ________________

STUDY TIME:

Study time

(in hours)

Group work Classroom and laboratory sessions

Sessions out of classroom

Individual Student 1

Student 2

Student 3

STATEMENT:

My signature below indicates that I have (1) made equitable contribution to EX 5 as a member of the group, (2) read and fully agree with the contents (i.e., results, conclusions, analyses, simulations) of this document, and (3) acknowledged by name anyone outside this group who assisted this learning team or any individual member in the completion of this document.

Today’s date: __________________

Active members Roles: (reporter, simulator, etc.)

(1) ________________________________________ _______________

(2) _________________________________________ _______________

(3) _________________________________________ _______________

Acknowledgement of individual(s) who assisted this group in completing this document:

1

Page 2: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EPSC – SDR: Reconfigurable Digital Systems

(1) _______________________

(2) _______________________

1.2 Abstract Explain here the most significant developments, results or conclusions about the exercise. Use the remaining space in this sheet (200 words maximum).

(This section is mandatory. You must complete it in order to get a mark.)

2

Page 3: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EX5: Designing a microcontroller-based one minute timer

CONTENT

A one-minute timer (preliminary).....................................................................................................................1

1.1 Cooperative group.....................................................................................................................................1

1.2 Abstract.....................................................................................................................................................1

1.3 Description................................................................................................................................................3

1.4 Topics........................................................................................................................................................3

1.5 Block diagram ad specifications for the one-minute timer.......................................................................3

1.6 Design flow and integrated development environment............................................................................4

1.7 PIC16F87X microcontrollers....................................................................................................................4

1.7.1 Architecture.......................................................................................................................................4

1.7.2 PIC assembler: RISC instruction set.................................................................................................6

1.8 Visiting microcontroller portals................................................................................................................6

1.9 Project flux diagram and programming style............................................................................................7

1.10 PIC16F87X peripherals.............................................................................................................................7

1.10.1 Attending peripheral by interruptions...............................................................................................8

1.10.2 I/O ports............................................................................................................................................8

1.10.3 Timer T0............................................................................................................................................8

1.10.4 Timer T1............................................................................................................................................9

1.10.5 Timer T2............................................................................................................................................9

1.10.6 A/D converter....................................................................................................................................9

1.10.7 EEPROM memory.............................................................................................................................9

1.10.8 UART.................................................................................................................................................9

1.10.9 I2C.....................................................................................................................................................9

1.11 Problem solution (títol 2)........................................................................................................................10

1.11.1 Part 1 (títol 3)..................................................................................................................................10

1.12 References...............................................................................................................................................11

1.13 Study plan to solve the exercise..............................................................................................................12

1.14 Topics and activities checklist................................................................................................................13

1.15 Grading grid............................................................................................................................................13

3

Page 4: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EPSC – SDR: Reconfigurable Digital Systems

1.16 Questions in solving EX 5.......................................................................................................................13

4

Page 5: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EX5: Designing a microcontroller-based one minute timer

1.3 DescriptionThis exercise will establish the basics for working with microcontrollers for the remaining of the term. Instead of continuing Chapter III trying for instance to design our own microprocessor like many books in VHDL does, we are going to buy a commercial one and program it using assembler or C. Therefore, the idea is to replace “hardware programming” by software programming.

Today the more available microprocessors and the easy to use and learn ones are placed inside a microcontroller, which consist of a complete computer architecture in a single chip: microprocessor, data and program memory and input/output peripherals.

There are a wide range of commercial microcontrollers to choose from in order to learn the basics and start applying them to build simple applications. We have decided to pick the CY8C29466 belonging to the PSOC family of flash microcontrollers from Cypress, one of the leading vendors.

This exercise will consist in developing a simple application like a one minute timer, using the input/output programmable ports and the microcontroller timers interfaced via polling or by interruptions.

The idea is to develop the project using C and the training boards from the vendor PSOCEVAL1 for prototyping the final design.

1.4 Topics After studying Chapter 4 and successfully completing all the assignments in this task, you will be able to:

1. Plan and develop through the design flow an example application such as a one minute digital timer using C.

2. Draw a program flow written in FSM style.

3. Write C code to monitor peripherals’ activity by both: polling techniques and interrupt service routines.

4. Prototype applications using training boards from Cypress

1.5 Block diagram ad specifications for the one-minute timera) Invent the block diagram for a one minute timer based on a CY8C29466 microcontroller. The minimum

specifications must include:

- Power supply: 5 V (from a 9 V battery or from the power mains using a voltage regulator)

- CY8C29466 microcontroller.

5

Page 6: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EPSC – SDR: Reconfigurable Digital Systems

Inputs:

- A pushbutton to set time in seconds

- A pushbutton to start down timing from the initial time count in seconds.

Outputs:

- A 2 digits BCD displayed at the LCD screen to show the timer count.

- An alarm LED which turns on when the timer count reaches zero (or a sound signal which is activated by the same condition).

1.6 Design flow and integrated development environment1.6.1 Installing PSOC Designer

b) Once having downloaded and installed the latest PSOC Designer software version from the Cypress web page, run a sample example written in C and explain the main procedures involved in the design process. Our web site contains examples from previous terms.

1.6.2 Installing the C compiler

c) Learn about the way to install the C compiler for the Cypress PSOC. Run a sample example written in C.

d) Draw a diagram explaining the Cypress PSOC design flow from project conception to final prototyping.

1.7 Designing the one minute timer

e) Follow the design flow until the specified application runs in the PSOCEVAL1 board. The application must be coded in C using a FSM approach.

Do not modify the text from page 3 to page 4

6

Page 7: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EX5: Designing a microcontroller-based one minute timer

1.8 Problem solution (títol 2)1.8.1 Part 1 (títol 3)

Part 1.1 (títol 4)

És necessari que seguiu aquestes indicacions per qualsevol dels vostres documents en aquesta assignatura. Aprendre-les forma part de la competència de comunicació escrita. Adapteu els vostres documents al format subministrat per aquesta plantilla.

Si alguna indicació o format no l’acabeu d’entendre bé, pregunteu-nos-ho o aclariu els dubtes, però no lliureu mai res que no compleixi aquestes indicacions perquè no us ho corregirem i perdreu el temps.

Afegiu aquí el vostre text (estil normal) encapçalat amb títols (Títol 2 i 3 i 4), amb figures (estil “llegenda” o “epígrafe”) i referències creuades en el text com aquesta Fig. 1 (és una referència creuada a la llegenda, veureu que surt en color gris quan la cliqueu) a les figures que inseriu. Fixeu-vos que la primera vegada que obrireu aquest document en Word 2007, no us sortirà aquesta llegenda “Fig.”, així que haureu de crear-ne una, i després, encara que la esborreu,ja us quedarà la referència. Veureu també que la numeració de les figures és un paràmetre automàtic. Si seleccioneu tot el document, i premeu “F9” actualitzareu tota la numeració.

També l’índex de la pag. 2 és completament automàtic. Es genera sol ( a partir de referències, índex de continguts, Inseriu un índex de continguts) i s’actualitza sol a partir també de “F9” havent seleccionat tot el text de document. És possible que la primera vegada que l’actualitzeu desaparegui. No passa res, simplement cal tornar-lo a generar a partir del menú referències i taula de contingut.

Fixeu-vos en la Fig. 1. Les imatges han d’estar centrades i alineades amb el text. Si voleu posar un parell d’imatges a la mateixa línia, inseriu primer una taula d’un parell de columnes i tot seguit feu invisibles les vores. El millor que podeu fer és “cut & paste” de la pròpia taula que veieu, i, canviar les figures per les vostres.

Feu referència també en el text a les fonts bibliogràfiques o de web que consulteu d’aquesta manera [1] (és una referència creuada a l’element numerat [1]). Expliqueu perquè les heu consultat i quina informació útil heu trobat.

Per corregir la primera versió del vostre treball, no imprimiu ni lliureu des de les pàgines 3 a la 5. És l’enunciat del problema. Sols cal que imprimiu les 2 primeres pàgines que contenen els detalls personals, el resum i l’índex, i a partir d’aquesta mateixa pàgina 6. Però feu-ho amb la numeració correcta. És a dir, treballeu sempre sobre aquest document, i en tot cas, importeu altres textos que tingueu cap a aquest mateix document i formateu-los correctament.

Insistim sobre això mateix: treballeu sempre sobre aquest mateix fitxer per preparar la vostra solució. Així usareu tots els estils i formats que ja té predefinits aquest document.

7

Page 8: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EPSC – SDR: Reconfigurable Digital Systems

Fig. 1 Exemple de peu de figura que segueix la numeració de l’enunciat (llegenda).

Heu d’instal·lar els correctors ortogràfics en català, espanyol i anglès en el vostre paquet d’eines office. I sobretot, corregir qualsevol error mentre escriviu. Si treballeu això estalviareu molta feina als vostres companys i instructors.

1.9 References Modify or add new references to this section. Follow the same format.

[1] http://epsc.upc.edu/projectes/ed/ . Comment: Course wed page where to find a lot of resources for the course. Specially, materials from previous editions. Read the section on theory about digital systems. [visited 12/2009]

[2] Brown,S., Vranesic, Z., “Fundamentals of digital logic with VHDL design”, McGraw-Hill, 2005. Comment: Figure 1. 7 contains an example of design flow for logic circuits and Figure 2.29 the structure of a typical CAD/EDA system.

[3] An image to define a concept map: http://redie.uabc.mx/contenido/vol2no1/art-11-eng/contenido-ruiz-figura1.png

8

Page 9: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EX5: Designing a microcontroller-based one minute timer

1.10 Study plan to solve the exercise

Establish a study plan, a task distribution scheme and other requirements to succeed in producing a good solution when working cooperatively: flux diagrams, concept maps, schematics, tables, pictures, etc.

(This section is mandatory. It must be filled in order to get a mark.)

9

Page 10: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EPSC – SDR: Reconfigurable Digital Systems

1.11 Topics and activities checklist

Topics Activities

Group member in

charge Comments

1 2 3

1.

2.

3.

4.

5.

1.12 Grading grid Here you are the way the exercise could be grades.

Part 1 Part 2 Part 3 Part 4

Total

Scores 2p 2p 3p 3p

Self-assessment

Instructor’s grades

1.13 Questions in solving EX 5Write here your questions, comments, doubts, opinions, etc. Add more sheets if necessary to report your progress or comments though the exercise.

Aquests fulls de dubtes i d’explicació de com heu anat fent l’exercici són obligatoris. Si no és present, no es corregeix l’exercici i s’ha de tornar a lliurar. Abans de corregir i posar-vos qualificacions volem saber quin ha estat procés en què heu dissenyat els circuits i comparar-lo amb les nostres pròpies observacions de classe.

10

Page 11: EX1 - digsys.upc.esdigsys.upc.es/.../EX/EX5/SDR_Curs_09-10_Q2_EX5.docx  · Web view1.10.8. UART9. 1.10.9. I2C9. 1.11Problem solution (títol 2) 10. 1.11.1. Part 1 (títol 3) 10

EX5: Designing a microcontroller-based one minute timer

11