CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

putchar & getch error??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sambyte



Joined: 29 Dec 2008
Posts: 12

View user's profile Send private message

putchar & getch error??
PostPosted: Tue Jan 06, 2009 12:14 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 1:25 pm     Reply with quote

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: 1938
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 1:31 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 2:19 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 2:30 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 2:35 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 2:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 3:06 pm     Reply with quote

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... Smile

But, in my code, the VSM debugger seems to hang because of EECON1,WR does not clr. Any clue??
Ttelmah
Guest







PostPosted: Wed Jan 07, 2009 3:50 am     Reply with quote

Pprobably means your emulator, does not actually emulate the EEPROM hardware. Quite a few don't emulate features like this.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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