electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

problem on count display on lcd in mikroC


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> problem on count display on lcd in mikroC
Author Message
bbgil



Joined: 11 Mar 2006
Posts: 131
Helped: 4


Post29 Oct 2007 4:00   

mikroc other char set for lcd ?


hi guys. i'm trying to make a simple count up display approximatel every sec on an lcd. It showing the character : but thats it. its not incrementing or doing anything else. I'm using PIC16f877a and lcd in 4-bit mode. any help would be appreciated.
Here is the code in mikroC.

unsigned short ch;
unsigned int t, cnt;
char a[17], *tc;
unsigned short sec;
long tlong;
void seconds;

void interrupt() {
cnt++; // Increment value of cnt on every interrupt
if (cnt==400)
for (sec=0 ; sec<=9u; sec++) {
ch= (sec);
Delay_ms (500);
cnt =0;

}
TMR0 = 96;
INTCON = 0x20; // Set T0IE, clear T0IF
}//~


void main() {
OPTION_REG = 0x84; // Assign prescaler to TMR0
TRISB = 0; // PORTB is output
PORTB = 0xFF; // Initialize PORTB
TMR0 = 96;
INTCON = 0xA0; // Enable TMRO interrupt

LCD_Init(&PORTB); // initialize (4-bit interface connection)
LCD_Cmd(LCD_CURSOR_OFF); // send command to LCD (cursor off)
LCD_Cmd(LCD_CLEAR); // send command to LCD (clear LCD)

tc = "Count is now:"; // assign text to string a
LCD_Out(1,1,tc); // print string a on LCD, 1st row, 1st column


TRISC = 0;
TRISD = 0;
Delay_ms(1000);
tc = "AM"; // assign text to string a
cnt=0;
do {
LCD_Out(2,13,tc);

ch=sec;
LCD_Chr(2,9, 48+ch);
Delay_ms (200);

} while (1) ;
}//~!
Back to top
Google
AdSense
Google Adsense




Post29 Oct 2007 4:00   

Ads




Back to top
nandhu015



Joined: 11 Feb 2006
Posts: 641
Helped: 46
Location: Tamilnadu, India


Post29 Oct 2007 14:28   

mikroc lcd_out problems


Hi

You missed two "{" in ur porgram

One "void main() {" add a opening "{"

and closing one at the end

Regards
Nandhu
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> problem on count display on lcd in mikroC
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Problem in LCD display in PIC 16f876 with 16x2 lcd display (3)
mikroC LCD text scrolling problem (3)
LCD Display Problem (10)
lcd display weird problem! (4)
problem of display number on LCD (1)
Help me please. Graphic LCD display problem (1)
Problem with 1x16 LCD...only 8 chars coming in display... (3)
16*2 LCD and PIC18F4550 interfacing using mikroC compiler (3)
LCD digit count up thing (1)
LCD Project to display my name on the LCD (3)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS