View previous topic :: View next topic |
Author |
Message |
sambyte
Joined: 29 Dec 2008 Posts: 12
|
putchar & getch error?? |
Posted: Tue Jan 06, 2009 12:14 pm |
|
|
The MPLAB compile error...
Quote: | Executing: "C:\Program files\Picc\CCSC.exe" +FM "P12F683PWM.c" +DF +LN +T +A +M +Z +Y=9 +EA
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 17(16,17): Undefined identifier -- getch
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 19(8,9): Undefined identifier -- putchar
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 45(12,13): Undefined identifier -- getch
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 49(15,16): Undefined identifier -- putchar
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 50(15,16): Undefined identifier -- putchar
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 51(15,16): Undefined identifier -- putchar
*** Error 12 "C:\Program Files\PICC\drivers\input.c" Line 56(14,15): Undefined identifier -- putchar |
Isn't that putchar (& getch) standard built-in function..?
What could it be...
I was trying to compile this example, "EX_INTEE.C"... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 06, 2009 1:25 pm |
|
|
Certain functions can only be used if the library is included in the
program. Libraries are included with a #use statement. Look at
#use rs232() in the CCS manual, or look at most sample code that
is posted in this forum for an example. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Tue Jan 06, 2009 1:31 pm |
|
|
To add to what PCM said, it also tells you for PUTChar (page 206 of the current manual) that #USE_RS232 is required. |
|
|
sambyte
Joined: 29 Dec 2008 Posts: 12
|
|
Posted: Tue Jan 06, 2009 2:19 pm |
|
|
Thanks guys..
Got it...
Code: |
...
#use delay(clock=8000000)
#use rs232(baud=9600, xmit=PIN_A1, rcv=PIN_A2)
/*
for dummy only (device doesn't have actual rs232)
>> to access some built-in functions
*/
... |
|
|
|
sambyte
Joined: 29 Dec 2008 Posts: 12
|
|
Posted: Tue Jan 06, 2009 2:30 pm |
|
|
What if I actually use the pin_A1 & pin_A2 for something else, that would actually create some I/O states.. How to avoid that..? Can I use non-existing pin names, for example, pin_D1 & pin _D2 on a P12 part? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 06, 2009 2:35 pm |
|
|
putc() and getc() require pins. They perform physical i/o.
Why would you want to use putc() and getc() without a physical RS-232
connection ? |
|
|
sambyte
Joined: 29 Dec 2008 Posts: 12
|
|
Posted: Tue Jan 06, 2009 2:54 pm |
|
|
I actually want to access EEPROM, read & write. The putc & getc happened to be in 'input.c' as shown in the EX_INTEE.c example. Is there a better way to access EE?? |
|
|
sambyte
Joined: 29 Dec 2008 Posts: 12
|
|
Posted: Tue Jan 06, 2009 3:06 pm |
|
|
I've just figured out the example uses rs232 just for a demo. EE access does not need these includes..
Code: |
//#include "stdlib.h"
//#include <input.c>
//#include "limits.h"
|
Thanks anyway...slowly getting there...
But, in my code, the VSM debugger seems to hang because of EECON1,WR does not clr. Any clue?? |
|
|
Ttelmah Guest
|
|
Posted: Wed Jan 07, 2009 3:50 am |
|
|
Pprobably means your emulator, does not actually emulate the EEPROM hardware. Quite a few don't emulate features like this.
Best Wishes |
|
|
|