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 support@ccsinfo.com

LMB204BDC with Flex 4 x 20 driver not displaying text
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 5:38 am     Reply with quote

PCM programmer wrote:

Let's configure the driver so it doesn't use the lcd's busy bit.


Done that, still first and third line boxes and second and fourth line empty Confused
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 7:54 am     Reply with quote

Hi,

Quote:

I get 2 errors:
unidentified identifyer
unidentified identifyer ANSEL


Ugh, sorry, that chip has no ANSEL register. I should have researched this a bit more before posting a solution that has worked with other PIC's, but that I wasn't 100% sure was applicable to this one Sad ........

Both I/O ports A and E have analog input capability, and there are several registers (each) that control the functionality of those ports. It might be worth looking at the .lst file generated during compile to be sure that port A and E are being configured for digital I/O.

John
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 9:12 am     Reply with quote

YAY, I got it to work by trying out a different PIC16F877a I had lying around and it worked! Thanks for all of your help.
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 5:11 pm     Reply with quote

DAMN! I somehow managed to burn the other PIC that worked. Is there a way to fix a burnt PIC? I program it using MicroPro and I get an error:
Quote:

ROM programming error at address 0x0001

Good 0x0000
Bad 0x0020

Or can I fix the other PIC that somehow doesn't work with the display??

Thanks in advance, I really need an answer soon as this should be finished by Sunday.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 5:37 pm     Reply with quote

How do you know it's the PIC ? Maybe it's a programmer problem.
You didn't post the part number of your programmer. But you should
search with Google for some tips on solving the problem. Example:
http://diykit.websitetoolbox.com/post?id=1511204
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 5:40 pm     Reply with quote

PCM programmer wrote:
How do you know it's the PIC ?

I know it's the PIC because I mistakenly connected the 12v power to the 5v power lines and the PIC became very hot. So I'm 100% sure it's the PIC.
Edit: My programmer is a K128 BTW.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 5:53 pm     Reply with quote

I don't think you can fix that problem. You have to get a new PIC.
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 5:56 pm     Reply with quote

PCM programmer wrote:
I don't think you can fix that problem. You have to get a new PIC.

How about the one that for some reason doesn't power the display?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 08, 2012 6:03 pm     Reply with quote

Maybe some of the i/o pins are not working on that PIC. Try using
pins on a different i/o port.
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Sat Jun 09, 2012 8:00 am     Reply with quote

PCM programmer wrote:
Maybe some of the i/o pins are not working on that PIC. Try using
pins on a different i/o port.


I bought two new PICs and everything works except for the display...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jun 09, 2012 2:48 pm     Reply with quote

Post a link to a schematic for your PIC circuit, including all connections
to the PIC and to the LCD (Power, ground, signals, external components,
values of components, etc).

Use a free image hosting service such as http://www.imageshack.us
to host the schematic file (.jpg, .gif, .bmp, etc.), then post the link here.
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Sat Jun 09, 2012 5:56 pm     Reply with quote

PCM programmer wrote:
Post a link to a schematic for your PIC circuit, including all connections
to the PIC and to the LCD (Power, ground, signals, external components,
values of components, etc).

Use a free image hosting service such as http://www.imageshack.us
to host the schematic file (.jpg, .gif, .bmp, etc.), then post the link here.


Nevermind, with a crapload of debugging, I found out that my screen also burned, so I bought a new screen, now I'm debugging my program... BTW, do you have an idea why the following code doesn't function properly?

Code:

   if(input_state(btn_A) && input_state(btn_B) && input_state(btn_C)) {
      beep();
      testScreen();
   }


and

Code:

while(true){
         if(input_state(btn_A)){
            beep();
            good();
            score += 10;
            updateDisplay(score);
         } else if(input_state(btn_B) || input_state(btn_C)){
            beep();
            bad();
         }
      }


Should I add
Code:
break;
between each of the {}?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jun 09, 2012 7:10 pm     Reply with quote

Quote:
do you have an idea why the following code doesn't function properly?

I need to know how your switches are wired - negative or positive logic.
Post a schematic of your push-button circuits. For example, this is the
normal way a push-button switch and its pullup resistor are connected
to a PIC i/o pin. This is negative logic. A button press causes a logic 0
to be applied to the input pin:
Code:

           +5v
            |
            <
            > 4.7K       
            <         ___  Switch 
To          |        _|_|_
PIC -----------------o   o------
pin                            |             
                              --- GND
                               -   



Quote:
Should I add break;
between each of the {}?

If you want to break out of the while loop after a certain button event
has occurred, then yes, you need to put a break statement at the end
of the code in each set of braces. That's what break is used for.
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Sat Jun 09, 2012 7:49 pm     Reply with quote

PCM programmer wrote:
Quote:
do you have an idea why the following code doesn't function properly?

I need to know how your switches are wired - negative or positive logic.


This is how my switches are wired

Code:

                      ___  Switch 
To                   _|_|_
PIC -----------------o   o------ +5v
pin                           


Please reply quickly as it's 3 AM and I need some sleep.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jun 09, 2012 8:30 pm     Reply with quote

That switch circuit can't supply two logic states. With that circuit, the PIC
pin is either a floating input or it's a logic "1". You need to fix that.
Change them all to the schematic that I posted. You will also need to
change the logic of your code to look for a logic "0" as the active state of
the switches.

If your switches are connected to pins on PortB, then you can enable
the built-in PortB pullups and save yourself from having to add the
resistors. All you have to do in that case is change the +5v connection
to be Ground instead.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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