|
|
View previous topic :: View next topic |
Author |
Message |
ahliang530
Joined: 18 Nov 2010 Posts: 9
|
|
Posted: Sun Jan 23, 2011 12:31 pm |
|
|
temtronic wrote: | Usually you have 'setup' or 'configuration' code before 'main', to tell the compiler what the I/O pins are to be used for,disabling interrupts,configuring onboard perihpherals,etc..
Since you haven't defined any I/O pins, perhaps there's a problem with the LCDDRIVER.C that you're using. |
this is the driver in CCS compiler .. i just rename it .. its actually LCDD.c |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Sun Jan 23, 2011 1:46 pm |
|
|
Where is your LCD wired up to( which port )?
Have you adjusted contrst to the mfr's spec( usually .5 -.8 volts). |
|
|
Bilal
Joined: 24 Apr 2010 Posts: 75 Location: Islamabad
|
try Simple |
Posted: Sun Jan 23, 2011 2:53 pm |
|
|
just try to run this..
Code: |
#include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include <LCDDRIVER.c>
void main()
{
lcd_init();
lcd_putc("\f");
delay_ms(10);
lcd_gotoxy(1,1);
printf(lcd_putc,"Hi, Milo 520");
while(1)
}
|
hope it will work _________________ ... |
|
|
ahliang530
Joined: 18 Nov 2010 Posts: 9
|
|
Posted: Sun Jan 23, 2011 9:53 pm |
|
|
temtronic wrote: | Where is your LCD wired up to( which port )?
Have you adjusted contrst to the mfr's spec( usually .5 -.8 volts). |
my wired is same as LCDD.c provided
port D
http://flic.kr/p/9cHFF1
i try on Proteus .. it can show me what i wan |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Mon Jan 24, 2011 6:25 am |
|
|
Sorry, can't help you with Proteus. It's a simulator and full of errors, bugs, etc.
I only build real circuits that I can test and use in the real world. |
|
|
ahliang530
Joined: 18 Nov 2010 Posts: 9
|
|
Posted: Mon Jan 24, 2011 6:59 pm |
|
|
temtronic wrote: | Sorry, can't help you with Proteus. It's a simulator and full of errors, bugs, etc.
I only build real circuits that I can test and use in the real world. |
btw is my connection correct? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Mon Jan 24, 2011 9:28 pm |
|
|
No, if you tried in the real world, nothing will happen..
Obvious errors include but not limited to
NO xtal
No caps for xtal
No Vss connection
No Vdd connection
No .1ufd cap at Vdd-Vss connections
Unknown voltage applied to _MCLR pullup
LCD is not wired correctly, hint contrast.
Unknown Vdd for the LCD
Once again, the 'pitfalls of Proteus'.
Let me guess. It 'compiles' fine using Proteus, no errors...
If I had a nickel for every error I can spot in a Proteus project, I'd be rich ! |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Tue Jan 25, 2011 6:25 am |
|
|
Temtronic
Actually, in this particular case, you'd have little to no money at all.
Proteus can do both digital and analog simulation, but in this case, it is a purely digital simulation. Thus no simulating of analog comenents is performed. Therefore you do not require a crystal. The CPU frequency is specified in the properties of the PIC model. And the contrast of the LCD is not modelled either, nor are the caps. As for power connections, they are hidden by default in the schematic.
Proteus certainly has its bugs (I've never had great luck with USB sims for example), but it appears worse than it actually is on these forums because 95% of the people posting with Proteus problems are using the cracked version, which is designed to simulate incorrectly and cause problems for the thief who is using it. Plus, many are students who are generally inexperienced with sims, or any electronics in general.
I own it and have found it to be a useful tool. Like you, I also prefer to use real hardware to test. But on two occasions, where the design used only SMT components, I designed, simulated and laid out a design with only Proteus and had a PCB produced with Proteus' output and the design worked great on powerup of the board.
Then again, I do not have a bias against simulators. Microcontrollers are only a sideline for me. I have spent 25 years designing ASICs and FPGAs. Simulation is the only design method we have for ASICs and complex FPGAs. You can't breadboard a 40 Gbit/s cellular radio basestation ! ;-)
r.b. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Tue Jan 25, 2011 6:59 am |
|
|
My comment about Proteus, is that if you wire up the real parts following the schematic that was shown to us, it will not work, and can never work.
While it may be obvious that this PIC needs a crystal and caps newer ones don't necessarily (16F88, 12F683). If you always 'build' in simulators you'll never see why the real stuff doesn't work. The same holds up for 'fuses', setup stuff, power supply. Or why the PIC crashes when the MIG welder cuts through rusty steel (not new steel) !
My avionics prof. docked me 5 marks because I failed to show the power switch (in the off position) in a schematic on a test. Fussy ?, maybe but his point was that you can't build or service anything if the schematic isn't correct. That test as back in 1973, yeesh 38 years ago ! Valid then, still valid now.
Currently, I'm using MPLAB v8.63 to 'interface' between PCM and the Picstart Plus programmer and there's a 'bug' that won't allow you to default the build option to 'release', the default is 'debug'. In order to burn a PIC, you have to change that option, then recompile, then burn the PIC for every project. After a week of frustration, I contacted MPLAB dev. team and they are changing the code to allow the user to choose the default options. The eng. had never used MPLAB this way....but I've done it that way for almost 20 years.
The tools that are available today, simulators, pcb layout, IDEs, etc. certainly make the job go easier and faster but to put 'blind faith' in someone else's product to design yours isn't necessarily a good choice. |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Tue Jan 25, 2011 9:17 am |
|
|
Quote: |
My comment about Proteus ,is that if you wire up the real parts following the schematic that was shown to us ,it will not work, and can never work.
While it may be obvious that this PIC needs a crystal and caps newer ones don't necessarily(16F88,12F683).If you always 'build' in simulators you'll never see why the real stuff doesn't work.
|
And I agree with you. When I use a digital simulator, I know that it does not model or care about bypass capacitors, I2C pull up resisters, crystals, etc. I know that my schematic will require all that later. And I know that because of my past experience, and my reading of data sheets, app notes, etc. Many of these people assume that these simulators are the Hand of God.
In reality, they are just one tool in your toolbox, and you rarely use a single tool for a project. And you also know and work with the shortcomings of each.
r.b. |
|
|
|
|
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
|