View previous topic :: View next topic |
Author |
Message |
Taylor3
Joined: 15 Apr 2014 Posts: 8 Location: Banned - spammer
|
library 74595 compilation |
Posted: Tue Apr 15, 2014 9:17 pm |
|
|
FRIENDS, I was testing the library over 74595 can not compile.
Can someone help me !?
actually I just wanted to compile and move on
74595 expecting an identifier error
|
|
|
alan
Joined: 12 Nov 2012 Posts: 357 Location: South Africa
|
|
Posted: Tue Apr 15, 2014 11:28 pm |
|
|
Post your compiler version.
Also your FUSES should be directly after your #include <16f84a.h> |
|
|
Taylor3
Joined: 15 Apr 2014 Posts: 8 Location: Banned - spammer
|
taylor3 |
Posted: Wed Apr 16, 2014 2:17 am |
|
|
ccs c 4.114
could make a demo?
74595.C how would |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Wed Apr 16, 2014 3:28 am |
|
|
You have already been told exactly what you need to do....
The key point is that the 'configuration stuff' (fuses, clock settings, RS232 if used etc.), _must_ be setup before they are used.
So the order in CCS is always (with tiny variations):
Code: |
///// marker 1
Processor include file
fuses
clock settings
RS232 settings
other setups (I2C etc).
/////marker 2
// Now the stuff between 'marker 1' and 'marker 2', can be separate or
// in an include file or even split up
//but basically (for instance), the clock must be set before RS232 is setup
//Fuses must be set before hardware is used, clock rate must be set
//before delays etc. etc. etc..
Then include other things
Then the main code
|
EX_EXPIO.c
shows how to use 74595.c
The '595' gives the 'expanded outputs', the '165' the inputs in this example.
Separately, what good is a blank 20 element constant array going to do?. You can't write to it (const), and there is nothing to read from it (empty)....
You do need the 'while' at the end of the code (you have it remmed out). Key is to remember that the code is all there is. Unlike on a PC, where code can exit, and drop 'back' to the operating system, on the PIC, there is nothing to go back to. So the code needs to ensure it stays running, and cannot drop 'off the end'. |
|
|
Taylor3
Joined: 15 Apr 2014 Posts: 8 Location: Banned - spammer
|
Taylor |
Posted: Thu Apr 17, 2014 7:43 pm |
|
|
did not work what could be?
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Fri Apr 18, 2014 1:47 am |
|
|
First you have probably edited the 74595.c file, and this is why it isn't working. Reload the original version with the compiler. The code compiles correctly with the supplied file. Tested with 5.025, 4.191, and 4.104.
Are you really using a 16F84A!....
Unless you really do need to be using history, get something newer. That was obsolete perhaps 10 years ago. |
|
|
|