Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
15 views
Copy of 371_2014_Q7
Copy of 371_2014_Q7
Uploaded by
ikokashechka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Copy of 371_2014_Q7 For Later
Download
Save
Save Copy of 371_2014_Q7 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
15 views
Copy of 371_2014_Q7
Copy of 371_2014_Q7
Uploaded by
ikokashechka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Copy of 371_2014_Q7 For Later
Carousel Previous
Carousel Next
Save
Save Copy of 371_2014_Q7 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 9
Search
Fullscreen
got Question 7: Embedded Application Programming in C (25 marks) page 8 of 11 ‘A system-on-a-chip FPGA hardware configuration has been defined as follows: Nios I processor __(no address range) address aren ROM (0x00000000-0x00003FFF) { Srcocosaoo Ti To)status S-BI input port data reg. (Ox00004400) | Oosoas |—=TaRRaE TN 8-bit output port data reg. (0x00004A80) Suarstin ; timer (0x00005000-0x00005010)~< 00005008 [________ start (lo) JTAG UART (data reg. 0x00006800, \o%xo000500¢ [stare hi status reg 0x00006804) : USE SCRAP PAPER RAM (0x00007000-0x00007FFF) TO DRAFT A SOLUTION Use the specifications below to write a € program for the above system hardware. * Assume that the Altera-provided exception handler is included, which makes a ‘normal subroutine call to a function named interrupt _handler(). + You must write the interrupt_handler() function in C to perform full checking to ‘identify the source of the interrupt, as if there were actually multiple sources. * Assume that macros NIOS2_WRITE_IENABLE(), NIOS2_WRITE_STATUS(), and NIOS2_READ_IPENDING() are available in the + With a 50-MHz clock input, configure a timer interrupt which is 5,000,000 cycles (0x004C4B40 in hexadecimal). + Assume that th 1e 8-bit parallel output port pins are connected to'8 LEDs. * At any time, . Every Gane ee * The main program must maintain SAT ORREMUMNET rer once ee + Every 4 seconds, the * The data read from the input parallel port ‘characters for hexadecimal digits, and they must be * After sending the two characters, the main program should’send a newline ‘character ('\n' or 0x0A) so that output appears on separate lines. + In addition to printing the data in ASCII form, the the * For the JTAG UART, the upper 16 bits of the status register indicate the amount of space available in the output buffer. A character is sent to the output buffer by writing a word to the data register with the character in the low 8 bits. * The ASCII code for '0" is 0x30 (or 48). The ASCII code for "Avis 0x41 (or 65). + You must organize your software with the following function: ~ void Init (void) ; void PrintChar (unsigned int ch); / void UpdateLEDs (void) ; v void interrupt_handler (void) ; int main (void) ;Elec 2a Zoi ao © —Maddy's “Tips. hii ee Pe ip Al tes Ul 3) Guaconteed to use Prat Ona a € Cree cetne laSo Cer Wing to do? = vocite oak prio Cha tee : because you nos youre garg to lave 4o_use neon | a ay (Plus. you already lenau 95% of Hreen and hats le Ake guestan) Notice T_hightighted * header Fle nios2 control th" ____fhis is _inpoctant be cause —ouc int and inleccugh hondlec Aanchions use the funchions ia ais Lie Mou NEED (ime, z7AG_uaRS, atc) 2€ : : ; ; Aaitialize fhe leds > 4op /boiton 4 gre tit, start all off or saith cited padeca, peolodloly go with one of he _pattecn Cod, so nean ypu code! (stack usit nik, g needed )Tridiabiganon Temprake . + PaatChec 2 a Aloid _Fnit (void) 4 TTo_intholiae Yhe ener. * * Tue start wt = O« SF * Timex status = 0 * “mer connen. = 0x3; ag cle shies Fes Ge Mond" v0" re_corksel cag. ussciiy ON > 0x4 (To isitialize ane qustablidien et partons mask 2 O00, ddegendts on outtons tennis bit + Burtows_Enac = 0 M “To seitiolize the gcten ted: 4 " ; P IL Sek ony Gags to shod salut { geaoaly 0) ceguced. BSI ea eee ee zsateccupt Handler Template. sa oid \ Cans ak tpending Speeding + W022 ReALIPENDING LA, if Gpending & oxf)== 1) 4 2cesek _iateccupt source. I do someting usually cati_arcther finchen oc seta Fas, —_____# iP 4hece 15 another inteccugt sorcce check it toot sP Chgendiag & Ox == 4)§,= Noid starit (void) 4 A set uo timnec + “MER START LO = Ox 4840; ieee es Serna eo ei ec + Timex _ status = 0; “TUMeR_Conteol = Ox Aimed Cag = 0; ek up Leo's + Gacem LEDS = Ox OF; MU Lowee 4 = 0000 WW\\_ > = Mone = fet Alina sebelalinbenctighs tandem eh a 0S 2 OL ol Que " tod lool @_addiesses given | aad __UpdaleLEds (void) 4 Lunsigred iat shat, Core € Us <23 4 ale = ~ Greew— LEDS ___4 Geeen reps = Ox 0F P (sie £ Ox of) ==1)4 3 + Geeen_ Lens = 0. FO swap 5.ad = (una) § iok__ipendiag iP(ligending 2 0x4) ==) 4 A cesek timer 4 TIMER STATUS = 0; Smit () Goat sir _\ed tiene = 0, Groat dle cradntine £0 aside 4) § if Uimec Gag == 4 4 dimec— Fog =O Neda time += 0.15 ead ke += 0.1 £ (led time == 0.5) updoielens (>; led. time =O} Bi & iP (vead time == 4) 4a MH get low. tad high bits to _sepacate digits. — uesigned int hac lo = input char £ 0x OF; tet: > i a corel ee ee if (chor lo 42 9) chac_to = cbaclo_+ 0x30 else Jooc—to = chac*lo_+ Ox 41 if (hace ni_<= 4) Clhachi_> chac_ni_+ 0x30, eise. hoc hi > chac_hi + Oxtl call % Prat Char ( chac-hid ; Print Choc char— to); Prat Chae ('\n');
You might also like
SattCon 05-OP Programmers Manual PDF
PDF
100% (1)
SattCon 05-OP Programmers Manual PDF
174 pages
Laboratory Report (For Online Lab Class Only) : ECTE333: Microcontroller Architecture and Application Spring 2020 Session
PDF
No ratings yet
Laboratory Report (For Online Lab Class Only) : ECTE333: Microcontroller Architecture and Application Spring 2020 Session
8 pages
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall PDF
PDF
100% (1)
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall PDF
64 pages
8051 Notes
PDF
No ratings yet
8051 Notes
34 pages
Embedded C
PDF
No ratings yet
Embedded C
9 pages
Tutorial Week 5 Answers
PDF
No ratings yet
Tutorial Week 5 Answers
8 pages
Cython A Guide For Python Programmers
PDF
100% (4)
Cython A Guide For Python Programmers
120 pages
EEE5232__Lecture-3
PDF
No ratings yet
EEE5232__Lecture-3
10 pages
Microprocessors and Interfacing Programming and Hardware 2nd Edi DL
PDF
No ratings yet
Microprocessors and Interfacing Programming and Hardware 2nd Edi DL
64 pages
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall PDF
PDF
No ratings yet
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall PDF
64 pages
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall PDF
PDF
No ratings yet
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall PDF
64 pages
7y8567857645ghj768 PDF
PDF
No ratings yet
7y8567857645ghj768 PDF
64 pages
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall
PDF
No ratings yet
Microprocessors and Interfacing Programming and Hardware 2nd Edition Solution Douglas V Hall
64 pages
Microprocessors and Interfacing Programming and Hware 2nd Edition Solution Douglas V Hall PDF
PDF
No ratings yet
Microprocessors and Interfacing Programming and Hware 2nd Edition Solution Douglas V Hall PDF
64 pages
Chapter 6 Thermodynamics
PDF
No ratings yet
Chapter 6 Thermodynamics
60 pages
MAE3780 Lab06 Prelab Solution 2014
PDF
No ratings yet
MAE3780 Lab06 Prelab Solution 2014
7 pages
Embedded Controller Solved Question Papers
PDF
No ratings yet
Embedded Controller Solved Question Papers
55 pages
Lab Task6,7,8,9,10
PDF
No ratings yet
Lab Task6,7,8,9,10
11 pages
EEL4742-Lab-Manual-Embedded Systems
PDF
No ratings yet
EEL4742-Lab-Manual-Embedded Systems
101 pages
Lab0 C
PDF
100% (1)
Lab0 C
5 pages
מעבדה למיקרו מחשבים- חוברת של החומר התיאורטי מאת שלמה אנגלברג
PDF
No ratings yet
מעבדה למיקרו מחשבים- חוברת של החומר התיאורטי מאת שלמה אנגלברג
136 pages
Gagandeep Singh, Assignment 3.doxc
PDF
No ratings yet
Gagandeep Singh, Assignment 3.doxc
23 pages
Class Notes
PDF
No ratings yet
Class Notes
64 pages
MPMC Assignment
PDF
No ratings yet
MPMC Assignment
17 pages
Embedded C
PDF
No ratings yet
Embedded C
16 pages
Microcontroller
PDF
No ratings yet
Microcontroller
25 pages
Girma Moges ES Embeded
PDF
No ratings yet
Girma Moges ES Embeded
27 pages
Lab 4: Digital Input Output: EE222: Microprocessor Systems
PDF
No ratings yet
Lab 4: Digital Input Output: EE222: Microprocessor Systems
5 pages
Kanishk Iot
PDF
No ratings yet
Kanishk Iot
51 pages
Lab2a - RGB LED PDF
PDF
0% (1)
Lab2a - RGB LED PDF
18 pages
Embedded Systems_cat_01
PDF
No ratings yet
Embedded Systems_cat_01
4 pages
Lecture 24
PDF
No ratings yet
Lecture 24
41 pages
REPORT
PDF
No ratings yet
REPORT
7 pages
Lab 1. A Digital Lock Preparation: Figure 1.1. Texas Io Window Showing The Door Is Unlocked
PDF
No ratings yet
Lab 1. A Digital Lock Preparation: Figure 1.1. Texas Io Window Showing The Door Is Unlocked
2 pages
Hardware
PDF
No ratings yet
Hardware
43 pages
DIGITAL SYSTEM (Mini Project Report)
PDF
No ratings yet
DIGITAL SYSTEM (Mini Project Report)
14 pages
Embedded (Ekta)
PDF
No ratings yet
Embedded (Ekta)
65 pages
Introduction To Proteus New
PDF
No ratings yet
Introduction To Proteus New
73 pages
89c51 Raining Cou Week1
PDF
No ratings yet
89c51 Raining Cou Week1
33 pages
MC Yashwant missed week
PDF
No ratings yet
MC Yashwant missed week
10 pages
C Programs ESY
PDF
No ratings yet
C Programs ESY
17 pages
Bee403 Vishal[1]
PDF
No ratings yet
Bee403 Vishal[1]
14 pages
stm32l152 Basic Programs
PDF
No ratings yet
stm32l152 Basic Programs
6 pages
Arduino 2
PDF
No ratings yet
Arduino 2
43 pages
Microprocessor Lab
PDF
No ratings yet
Microprocessor Lab
9 pages
1 Interfacing Stepper Motor To 8086 Using 8255
PDF
82% (11)
1 Interfacing Stepper Motor To 8086 Using 8255
40 pages
SOLUTIONS of Ytha Yu Charles Marut-Assem
PDF
No ratings yet
SOLUTIONS of Ytha Yu Charles Marut-Assem
6 pages
Unit IV Interfacing I-O Devices-2
PDF
No ratings yet
Unit IV Interfacing I-O Devices-2
26 pages
datorlab1
PDF
No ratings yet
datorlab1
36 pages
Iot Group Pro
PDF
No ratings yet
Iot Group Pro
52 pages
Presentation On Topic "Programming IN Embedded C": BY:-Aman Sharma Dronacharya College of Engineering
PDF
No ratings yet
Presentation On Topic "Programming IN Embedded C": BY:-Aman Sharma Dronacharya College of Engineering
22 pages
Workshop 4: Digital Electronics & Microcontroller
PDF
No ratings yet
Workshop 4: Digital Electronics & Microcontroller
2 pages
Unit -II
PDF
No ratings yet
Unit -II
26 pages
Arduino
PDF
100% (1)
Arduino
43 pages
Lab Manual
PDF
No ratings yet
Lab Manual
101 pages
Programs
PDF
No ratings yet
Programs
12 pages