Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

GLCD Proteus problem !

Status
Not open for further replies.

metaru_nanbu

Newbie level 4
Newbie level 4
Joined
Apr 14, 2013
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,328
Hey everyone !
===========
I'm using the ProGFX library with Atmel ATMEGA32 chip on Proteus simulator to make a simple test...
But it Gives me the warning : LOGIC contention detected , and it gives me a corrupted output on the LCD...what am i doing wrong ?
The code is supposed to fill the whole LCD black.
=========
Please help.
Attached an image of the simulation for the "LCD filling code" and the "drawing x and y axes code"
with HEX file.

Here's my CODE.

Code:
#include <gfx.h>
#include <font.h>
#include <fonts/arial12.h>
#include <math.h>

int main()
{

DDRC = 0xFF;

GFXInit();

GFXSetFont(Arial12);

GFXFillRect(0,0,127,63,GFX_COLOR_BLACK);

GFXUpdate();

}

View attachment PROTEUS MODEL.rar
View attachment HEX FILE.rar
z.jpg
HEX HEX.jpg
 

Attachments

  • untitled.jpg
    untitled.jpg
    434.7 KB · Views: 155
Last edited:

Logic Contention errors happen when some pins act as both output and input at the same time ie., if you configured some pin as output and then writing data to it ot configuring some pin as input and ten sending data out of it. I see you use PORTB, C, D for GLCD. Make ALL pins of PORTB, C, D as output pins using DDRBA = 0xFF; DDRC = 0xFF; DDRD = 0xFF; and Clear all the ports during initialization. See if it works.

Post your code so that it can be fixed.

89358d1365949418-glcd1.jpg

89359d1365949428-glcd2.jpg
 

Attachments

  • glcd1.jpg
    glcd1.jpg
    318.6 KB · Views: 194
  • glcd2.jpg
    glcd2.jpg
    299.6 KB · Views: 153
Last edited:
If the same wire is not used as both input and output, then you try to rewire the circuit and check simulation once again
 
Thanks for the reply, really appreciate it !
I've tried adding those initialization lines but still getting logic contention error.
Please check this code !

Code:
#include <gfx.h>
#include <font.h>
#include <fonts/arial12.h>
#include <math.h>

int main()
{

DDRA = 0xFF;
DDRB = 0xFF;
DDRC = 0xFF;
DDRD = 0xFF;

PORTA=0;
PORTB=0;
PORTC=0;
PORTD=0;

GFXInit();

GFXSetFont(Arial12);

GFXFillRect(0,0,127,63,GFX_COLOR_BLACK);

GFXUpdate();

}
 

Then you have to dig deep inside gfx.h file. See if any Port is made as input in the header file. If you post the GLCD library files used in the project it will be helpful.

I see there is no while(1) loop in your code.

I see logic contention only on PORTC. Maybe it is a bug of Proteus. Try with another AVR microcontroller and see if you get the same error(s).
 
Last edited:
It is the same Proteus file you sent. It is displaying properly but PORTC has logic contentions. Send me your new hex file. I will test it. There is no problem with the library files.
 

Attachments

  • PROTEUS MODEL.rar
    42.7 KB · Views: 111
Ok will try that.
i changed the GLCD and it gave the same result.

It's weird how it's displaying properly for your version of proteus and not for mine....
....What's your version of proteus ?
 

How can i edit the library or even see it's contents ?
i can only access the header files which does not contain the actual functions.....
Please help ! thanks in advance.
 

Thanks a LOT !

Few questions :
1- Is it safe to ignore the "logic contention" warnings and continue working on the project ?
2- What file should i include in order for the delay function to work in AVR studio 4 ( i tried delay.h , but it gives an error that it does not exist ) ?

I really appreciate the replies...Thanks again !
 

Try in real hardware it might work. Don't know about AVR Studio 4. I use v6. Use AVR Studio 6 instead or go to AVR Studio folder and search where the delay.h file is. If it is in Include\Utils\delay.h then in the include use

#include <\util\delay.h>
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top