CSSE3010 - Embedded Systems Design and Interfacing Stage 2R

Java Python Embedded Systems Design and Interfacing

CSSE3010 Stage 2

RGB LED Colour Control

1    Assessment

•  Git and Work Diagrams due 3pm Monday in week 5 .

•  Demo marked in your lab session in week 5 .

•  Course Marks: 7.5%

2    Resources

• Nucleo platform.

• LTA1000G LED Bar

• MultiFunctional Shield (MFS)

• RGB LED Module

•  SN74HC03N NAND gate

• Logic Analyser

• Logic Probe

3    Academic Integrity

All assessments are individual. You should feel free to discuss aspects of C programming and assessment specifications with fellow students and discuss the related APIs in general terms. You should not actively help (or seek help from) other students with the actual coding of your assessment. It is cheating to look at another student’s code, and it is cheating to allow your code to be seen or shared in printed or electronic form. You should note that all submitted code will be subject to automated checks for plagiarism and collusion.  If we detect plagiarism or collusion (outside of the base code given to everyone), formal misconduct proceedings will be initiated against you. If you’re having trouble, seek help from a teaching staff member. Do not be tempted to copy another student’s code. You should read and understand the state- mentson student misconduct in the course profile and on the school website

3.1    Use of AI Tools

All assessment tasks evaluate students’ abilities, skills and knowledge without the aid of generative Artificial Intelligence (AI) or Machine Translation (MT). Students are advised that the use of AI technologies to  develop responses  (e.g.   code  generation)  is  strictly prohibited and may constitute student misconduct under the Student Code of Conduct.

4    Structure

Your final stage code must be titled main . c and saved in your s2   folder. PATH: csse3010/repo/s2

Listed below are the required mylib libraries, that you will need to develop for this stage. They should be saved in your mylib folder.

PATH: csse3010/repo/mylib.

• MFS Trimpot Library

• MFS Pushbutton Library

• RGB LED Library

• LTA1000G Library

5    Introduction

This stage will introduce the Timer, Pulse Width Modulation and Analog to Digital Con- verter (ADC) Peripherals of the Nucleo platform. You will use the RGB LED, SN74HC03N NAND gate, LED Bar, and MFS Trimpot.

6    Preparation

It is recommended that you attempt the following labs first before starting this stage. The labs or lab quizzes are not assessed.

•  Lab 2.4, 2.5, 2.6, 2.7 - Analog, Timers, PWM

• Lab 3.1, 3.4 - RGB LED, Logic Analyser, MFS

• Lab 1.5 - Flow Charts

6.1    Black Board Quiz

The Blackboard quiz contains helpful questions related to this stage. It must be completed and submitted on BlackBoard.

7    Design Tasks

Control the colour and brightness of an RGB LED, using the MFS pushbutton and trimpot. Also, display the current brightness on the LTA1000G LED bar.

7.1    Work Diagram Tasks

Follow the work diagram guidelines on Blackboard. You need to use the hardware and flow chart templates. You must draw the hardware schematic for this stage. You must draw and submit the flow chart for the ‘sxxxxxxx reg rgb brightness write‘ function. No other flow charts are to be submitted. You are encouraged to draw flow charts for the other mylib register functions. State diagrams are not used for this stage. The work diagram task is due in week 5 , on Black Board.

7.1.1    Timing Diagram

You must use the waveform template (from Black Board) to show the signals listed below. The signals must be captured using the logic analyzer (e.g. screenshot). You must show at least 5 RGB colour changes.

1.  RGB Brightness Signal (PWM)

2.  RGB Red, Green, and Blue Signals

3.  SYSMON CHAN0 signal. See Table 5.

4.  SYSMON CHAN1 signal. See Table 5.

7.1.2    mylib Setup

You MUST FOLLOW the Template Code given in the sourcelib/templates/mylib folder. Your mylib code must meet the guidelines specified in the mylib and plat- form build guides on Blackboard.  You MUST create the right file structure in the mylib git folder.

You will create mylib Register library files to control the RGB LED module.  For details, refer to the mylib RGB register specifications on Blackboard.

7.2    Design Task 1: RGB LED Control Circuit

Create a circuit using the SN74HC03N NAND gate to control the colour and brightness of the RGB LED. Note: the RGB LED V signal must be connected to the breadboard power supply line (Vcc) and should not be controlled. GPIO pins must be used to control the colour of the RGB LED, using the SN74HC03N NAND gate. A PWM signal must be used to control the brightness of the RGB LED.

7.2.1    Logic Analyzer Test Points

Your circuit must include the logic analyser test points (see lab 3.1) for the RGB LED. All RGB LED  (red, green, blue) and brightness control signals must be viewed on the logic analyzer.  The RGB LED pins must be vertically inserted into the breadboard.  The test points for the logic analyser must be used to view the RGB signals. The logic analyser test points must be drawn on the hardware schematic.

DO NOT cut any wires for the breadboard.  Use male-to-male jumper wires.  Spare jumper wires are available in the lab. Do not use any of the wire spools (cutters). Do not use other breadboard wires (e.g. breadboard wires used in CSSE2010).

See section 9 for the pins used.

7.3    Design Task 2:  RGB LED Control using the MFS Trimpot and Pushbutton

Use the MFS trimpot to control the colour of the RGB LED. Each complete turn of the MFS trimpot must change the RGB colour to the next colour in the sequence. When the end of the sequence is reached, the sequence should wrap around to the start of the sequence. The sequence of colours can be seen in table 1 and table 2. Note the initial colour is Black (off), before the first MFS trimpot turn.

Table 1:  Colour sequence

Sequence

Colour

1

Red

2

Green

3

Blue

4

Cyan

5

Magenta

6

Yellow

7

White

8

Black (off)

Table 2: RGB Primary Colour Table

Colour

RGB Value

Black

0x07

Blue

0x06

Green

0x05

Cyan

0x04

Red

0x03

Magenta

0x02

Yellow

0x01

White

0x00

Use the MFS S1 to control the RGB brightness.  This involves controlling the brightness of the red, green, and blue LEDs of the RGB LED. Each time the MFS S1 is pressed, the brightness must increase by 10% (of the duty cycle).  The initial brightness must be 0%. After 10 presses, the brightness must reset back to 0%.

The RGB brightness must be controlled with a PWM signal, using the parameters in table 3. Hint:  use the logic analyzer to check the PWM waveform.

Table 3:  PWM Brightness Control Signal Parameters

Parameter

Value

Frequency

100Hz

Maximum Pulse Width

5ms

Minimum Pulse Width

0ms

7.4    Design Task 3: RGB LED Brightness Display using LTA1000G

LED Bar

Use the LTA1000G LED Bar to display the brightness level (0% to 100%)) of the RGB LED. Each LED segment represents a brightness level increase of 10%.  Only one LED segment should be on for a non-zero brightness level). See Table 4.

Table 4:  LED Bar Segment Assignment

Segment

RGB LED Brightness

0

10%

1

20%

2

30%

3

40%

4

50%

5

60%

6

70%

7

80%

8

90%

9

100%

You will need to use the sxxxxxxx reg rgb brightness read() function. You must use your mfs pusbhutton, mfs  trimpot, rgb and LTA1000G register mylib drivers.  See section 9 for the LED Bar connections.

Refer to gpio/gpio and pwm/dynamic examples.

7.5    Design Task 4:  Testing

You must add the following test signal outputs using the system monitor (SYSMON). You can view the test signals using a logic probe, logic analyser, or oscilloscope (only available in the lab).  You must use the SYSMONCHAN functions to initialise and manipulate the SYSMONCHAN pins.  You should not create any extra mylib functions or files relating to the system monitor .

Table 5:  Test Signals

SYSMONCHAN

Function

SYSMONCHAN0

Must toggle every time the RGB Brightness is changed.

SYSMONCHAN1

Must toggle every time the RGB colour is changed.

SYSMONCHAN2

Not used.  (Can be used for debugging, if required)

See section 9 for the board pins used for the SYSMONCHAN signals. Refer to the getting-started/sysmon.  example

8    Integration

All design tasks should be combined into the same main . c file and should function without reprograming the board for each design task.

9    Pin Assignments

NOTE: The pins listed here are Board Pins only. You must map them to the Processor Pins using the Nucleo Pinout for your board.

9.1    Nucleo-F429

Board Pins

Notes

CN11 Connector pins 62, 64, 66, 68, 70

Connect to LED Bar pins 0 to 4.

CN12 Connector pins 62, 64, 66, 68, 70

Connect to LED Bar pins 5 to 9         

《嵌入式实时软件设计PDF》是一本关于嵌入式系统实时软件设计的电子书籍。嵌入式系统是一种专用计算机系统,嵌入于其他设备或系统中,用于控制、监测、通信等任务。实时软件设计对于嵌入式系统至关重要,因为嵌入式系统通常需要在特定时间要求下执行任务,例如飞行控制、汽车制动等。 这本电子书主要介绍了实时软件设计所涉及的关键概念、原则和方法。首先,它涵盖了嵌入式系统的基本概念和架构,以及软硬件接口。然后,它详细介绍了实时系统的特点和要求,包括任务调度、优先级和时间约束等。此外,该书还涵盖了实时操作系统的设计和使用,以及实时系统的调试和测试方法。 在这本书中,读者将学习如何设计出满足嵌入式系统实时需求的软件。通过了解实时系统的特点和要求,读者可以学习到如何选择合适的任务调度算法,如何确定任务的优先级,以及如何处理任务之间的时间约束。此外,该书还介绍了常用的实时操作系统,如VxWorks和FreeRTOS等。读者可以学习到如何使用这些实时操作系统来简化实时软件设计和开发过程。 总之,《嵌入式实时软件设计PDF》是一本涵盖了嵌入式系统实时软件设计所需知识的重要参考书。通过阅读这本书,读者可以获得关于实时软件设计的全面理解,并能够应用这些知识来设计和开发高效可靠的嵌入式系统。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值