Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Is there anybody who knows how to do this? Here\'s how it works: Suppose you wan

ID: 3551389 • Letter: I

Question

Is there anybody who knows how to do this? Here's how it works:


Suppose you want to use PSoC to display a different brand name on the LCD once every 15 s. You have decided to use PSoC Timer block to generate interrupt on terminal count and then write an interrupt service routine to output the brand name on the LCD. Please clearly indicate whether you would use an 8-bit, 16-bit, 24-bit, or 32-bit Timer block. Also, clearly indicate how you want to configure the clock input to the Timer block and what period value you will choose for the Timer block. (Please clearly show your related calculation details.)

Explanation / Answer

C code for display.



#include <device.h>



/* An array of pixels to print on the LCD */

#define PIXELCNT 10

int32 pixels[PIXELCNT][3] = {

/* X, Y, Color */

{ 91, 91, GLCD_BLUE },

{ 96, 98, GLCD_YELLOW},

{ 92, 95, GLCD_GREEN},

{ 97, 93, GLCD_PURPLE},

{ 94, 94, GLCD_RED },

{ 92, 96, GLCD_RED },

{ 95, 92, GLCD_YELLOW },

{ 98, 97, GLCD_YELLOW },

{ 93, 99, GLCD_BLUE },

{ 99, 96, GLCD_GREEN }

};

void main()

{

uint32 i;

/* Initialize LCD */

GLCD_Start();

GLCD_On();

GLCD_Contrast(60);

GLCD_Clear(GLCD_BLACK); /* Make background black */


/* Blue text with white background */

GLCD_PrintString(" Hello PSoC 4 ", 5, 8, GLCD_BLUE, GLCD_WHITE);


/* Draw four unfilled rectangles at bottom of screen */

GLCD_DrawRect(78, 8,102, 22, 0, GLCD_GREEN);

GLCD_DrawRect(78,28,102, 42, 0, GLCD_BLUE);

GLCD_DrawRect(78,48,102, 62, 0, GLCD_YELLOW);

GLCD_DrawRect(78,68,102, 82, 0, GLCD_RED);

/* Four color filed rectangles */

GLCD_DrawRect(80,10,100, 20, 1, GLCD_GREEN);

GLCD_DrawRect(80,30,100, 40, 1, GLCD_BLUE);

GLCD_DrawRect(80,50,100, 60, 1, GLCD_YELLOW);

GLCD_DrawRect(80,70,100, 80, 1, GLCD_RED);

/* Green text with black background */

GLCD_PrintString("1234", 40, 10, GLCD_GREEN, GLCD_BLACK);

/* Horizontal Green line */

GLCD_DrawLine(65, 10, 65, 50, GLCD_GREEN);

/* Vertical Red line */

GLCD_DrawLine(30, 65, 60, 65, GLCD_RED);

/* Diagonal White line */

GLCD_DrawLine(65, 70, 90, 115, GLCD_WHITE);

/* Four concentric circles */

GLCD_DrawCircle (50, 95, 20, GLCD_RED );

GLCD_DrawCircle (50, 95, 15, GLCD_WHITE );

GLCD_DrawCircle (50, 95, 10, GLCD_GREEN );

GLCD_DrawCircle (50, 95, 5, GLCD_YELLOW );

/* Green text on blue background in a red rectangle */

GLCD_DrawRect(107, 30, 129, 92, 0, GLCD_RED);

GLCD_PrintString("ABCDEFG", 108, 32, GLCD_GREEN, GLCD_BLUE);


/* Put array of pixels in a box */

GLCD_DrawRect(90, 90, 100, 100, 0, GLCD_WHITE);

for (i= 0; i < PIXELCNT; i++)

{

GLCD_Pixel(pixels[i][0],pixels[i][1], pixels[i][2] );

}

CyDelay(5000);

/* Turn off display */

/* GLCD_Stop(); */

for(;;)

{

/* Loop forever */   

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote