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

GLCD Working Except Problem On Proteus

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



Joined: 25 Aug 2011
Posts: 17

View user's profile Send private message

GLCD Working Except Problem On Proteus
PostPosted: Thu Aug 25, 2011 4:45 pm     Reply with quote

I have some code that I am using (mainly glcd library stuff) but whenever I run this code on proteus, it gives me logic contention error. The pins seems to be random and change whenever I open and close proteus.


Does anyone know what is going on???

Here is my code:

Code:

/////////////////////////////////////////////////////////////////////////
////                           HDM64GS12.c                           ////

#ifndef HDM64GS12
#define HDM64GS12

#ifndef GLCD_WIDTH
#define GLCD_WIDTH   128
#endif

#ifndef GLCD_CS1
#define GLCD_CS1     PIN_A1   // Chip Selection 1
#endif

#ifndef GLCD_CS2
#define GLCD_CS2     PIN_A0   // Chip Selection 2
#endif

#ifndef GLCD_DI
#define GLCD_DI      PIN_A2   // Data or Instruction input
#endif

#ifndef GLCD_RW
#define GLCD_RW      PIN_A3   // Read/Write
#endif

#ifndef GLCD_E
#define GLCD_E       PIN_A4   // Enable
#endif

#ifndef GLCD_RST
#define GLCD_RST     PIN_A5   // Reset
#endif

#define GLCD_LEFT    0
#define GLCD_RIGHT   1

#ifndef ON
#define ON           1
#endif

#ifndef OFF
#define OFF          0
#endif

#include <16f877.h>
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
#FUSES NOBROWNOUT               //No brownout reset

#use delay(clock=20000000)

void glcd_init(int1 mode)
{
   // Initialze some pins
   output_high(GLCD_RST);
   output_low(GLCD_E);
   output_low(GLCD_CS1);
   output_low(GLCD_CS2);

   output_low(GLCD_DI);                 // Set for instruction


Another graphics file
Code:

/////////////////////////////////////////////////////////////////////////
////                          graphics.c                             ////
////                                                                 ////



++++++++++++++++++++++++++++++

CCS Driver files mostly deleted.

Reason: Forum rule #10

10. Don't post the CCS example code or drivers, or ask for such code and drivers.

Forum rules:
http://www.ccsinfo.com/forum/viewtopic.php?t=26245

-- Forum Moderator
++++++++++++++++++++++++++++++
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Aug 25, 2011 5:08 pm     Reply with quote

Sounds like yet ANOTHER Proteus problem! I recommend you go to the
Proteus site and ask them since it is likely NOT a CCS problem.
_________________
Google and Forum Search are some of your best tools!!!!
haronraziq



Joined: 25 Aug 2011
Posts: 17

View user's profile Send private message

GLCD Working Except Problem On Proteus
PostPosted: Thu Aug 25, 2011 5:31 pm     Reply with quote

Interesting development, if I switch the LCD port to PORTB it works like a charm. Why is this?

The problem is, then I will not be able to freely program the microcontroller. Does anyone know if Pickit programmers, in particular the canakit programmer supports high voltage programming?
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Aug 25, 2011 5:36 pm     Reply with quote

Yes they are "high voltage" programmers.
As for Port B, did you add a pullup to A4 and turn off the ADCs?
_________________
Google and Forum Search are some of your best tools!!!!
haronraziq



Joined: 25 Aug 2011
Posts: 17

View user's profile Send private message

GLCD Working Except Problem On Proteus
PostPosted: Thu Aug 25, 2011 5:40 pm     Reply with quote

Yeah I added the pullup on A4 but I am actually trying to move those ports to something else because I want to use the analog ports for another part of my circuit.
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