Welcome to Planetpsoc

Controlling GPIO using Firmware

E-mail Print PDF
( 2 Votes )

Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

Question: How do I control a GPIO through the CPU in firmware?

Answer:  To control a GPIO using the CPU, first the GPIO pin should be set to StdCPU mode in the GPIO configuration window in device editor.  The drive mode should be set to any mode other than HighZ or HighZ Analog.  Now the pin may be controlled by writing to the PRTxDR register.  Following are some examples in assembly and C.

Tags: PSoC1 GPIO
Read more...
 

Converting Float to ASCII

E-mail Print PDF
( 3 Votes )

Question: How do I convert a float value to ASCII and display it on an LCD or transmit over a UART TX?

Answer:  A float value can be converted to ASCII string using the ftoa function and then displayed on LCD using the LCD_PrString function or transmitted through UART using UART_PutString or TX8_PutString functions.

Read more...
 


Page 22 of 22