Answer: An integer value can be converted to ASCII string using the itoa function and then displayed on LCD using the LCD_PrString function or transmitted through UART using UART_PutString or TX8_PutString functions.
Prototype: char *itoa(char *string, int value, int base);
Parameters:
*string - Pointer to a string where the converted ASCII result has to be stored
value - The integer value to be converted
base - Base of conversion
Return:
The function returns the pointer of the string where the ASCII result is stored.
Code Samples
Display an integer on LCD
#include “stdlib.h”
int MyInt = -30000; // Integer value to be converted and displayed
char AsciiString[7]; // Buffer to store the Ascii result
LCD_Position(0,0);
LCD_PrString(itoa(AsciiString, MyInt, 10));
Note: Code assumes that an LCD user module named “LCD” has been placed in the project and the LCD has been initialized
Transmit an integer value as ascii string over UART
#include “stdlib.h”
int MyInt = -30000; // Integer value to be converted and displayed
char AsciiString[7]; // Buffer to store the Ascii result
UART_PutString(itoa(AsciiString, MyInt, 10));
Note: Code assumes that an UART user module has been placed, configured and initialized




But in your example "Display an integer on LCD" you use a value which is to big for an integer. It should be 32768 at most. Otherwise you receive a false value on the lcd.