View previous topic :: View next topic |
Author |
Message |
haronraziq
Joined: 25 Aug 2011 Posts: 17
|
GLCD Working Except Problem On Proteus |
Posted: Thu Aug 25, 2011 4:45 pm |
|
|
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: 1933 Location: Norman, OK
|
|
Posted: Thu Aug 25, 2011 5:08 pm |
|
|
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
|
GLCD Working Except Problem On Proteus |
Posted: Thu Aug 25, 2011 5:31 pm |
|
|
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: 1933 Location: Norman, OK
|
|
Posted: Thu Aug 25, 2011 5:36 pm |
|
|
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
|
GLCD Working Except Problem On Proteus |
Posted: Thu Aug 25, 2011 5:40 pm |
|
|
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. |
|
|
|