CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

8 bit input checking

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dong sung
Guest







8 bit input checking
PostPosted: Thu Mar 23, 2006 6:07 pm     Reply with quote

hello all,
I have a 8 bit input at port B.(I pulled up port B to TRUE)This value is displayed on LCD.Now I want LCD to keep displaying "Dong the king" till it actually gets input at port B.I saw lotss of codes in this forum .help me.

My question --- how I check if I am getting 8 bit input?


int8 dong;
//I display"Dong the king"here
dong = input_b();
if(dong!=11111111)// THIS CORRECT WAY??I USED NOT 1111111 since port B is pulled up TRUE initially
{
//if PIC getting input
}

Sorry poor ennglish
Dong
Dong
Guest







PostPosted: Thu Mar 23, 2006 11:08 pm     Reply with quote

Do I use 255 when checking???

how do I make my message on LCD flashing??

Thanks,
Dong
dong
Guest







PostPosted: Thu Mar 23, 2006 11:12 pm     Reply with quote

sorry one more question:
Sometimes my LCd acts weird when I switch on the power and my 8 bit input is already connected.It shows blocks.

But when I attach input wires after LCD is powered on,it shows correct messages.Why is this?

Thank you all

Dong
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 24, 2006 12:09 am     Reply with quote

If you're not using decimal, then you have to tell the compiler
what the number system is. This is done by putting "0x" in front
of the value for Hex, or "0b" for binary, etc.
Quote:

Decimal: 255

Hex: 0xFF

Binary: 0b11111111

Ideally, you should learn this in the classroom or from a textbook,
instead of on this forum. The forum should be for more advanced
topics.
Dong
Guest







re:one question
PostPosted: Fri Mar 24, 2006 4:21 am     Reply with quote

thanx
one problem:
Sometimes my LCd acts weird when I switch on the power and my 8 bit input is already connected.It shows blocks.

But when I attach input wires after LCD is powered on,it shows correct messages.Why is this?

what do i do??

dong
mpfj



Joined: 09 Sep 2003
Posts: 95
Location: UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 24, 2006 4:49 am     Reply with quote

Dong wrote:
Sometimes my LCd acts weird when I switch on the power and my 8 bit input is already connected. It shows blocks.

The LCD will contain some RAM to store the pixel information it will display. When you write to the LCD, the data you send is stored in this RAM, and the LCD then reads the RAM contents and "converts" the data into pixels that are on or off.

When you first power on the LCD, the RAM will usually come up in a random state, since you haven't written anything to it. This is the "weird" behaviour that you are seeing.

So the first thing you need to do is to initialise the LCD by setting the entire RAM to some known value (usually 0x00).

Consult the datasheet for the LCD (or the LCD controller chip). This should have some more information.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group