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 support@ccsinfo.com

using variable with output_low
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jeeshenlee



Joined: 15 Apr 2011
Posts: 3

View user's profile Send private message Visit poster's website Yahoo Messenger

PostPosted: Fri Apr 15, 2011 11:37 pm     Reply with quote

I'm using PCM 4.088.

Ya, i tried input_state(variable) and it gave me "Expression need to be in constant..."
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 16, 2011 12:43 am     Reply with quote

Try using the read_bit_var() macro. For the PCM compiler, the variable
parameter must be an int8. For PCH, it must be an int16.

If you have problems, I can't really do anything more about it now.
Maybe later in the weekend.
jeeshenlee



Joined: 15 Apr 2011
Posts: 3

View user's profile Send private message Visit poster's website Yahoo Messenger

PostPosted: Sat Apr 16, 2011 1:19 am     Reply with quote

Alright. Thanks.
net_hw



Joined: 17 Oct 2012
Posts: 6

View user's profile Send private message

trying to use the function do_pin_io( ) some doubts
PostPosted: Tue Nov 06, 2012 4:00 am     Reply with quote

Hello all

I swear that I tried
with based on this examples:

http://www.ccsinfo.com/forum/viewtopic.php?t=48590&highlight=ccspin+pintable+pinn

http://www.ccsinfo.com/forum/viewtopic.php?
t=25591&postdays=0&postorder=asc&start=0

http://www.ccsinfo.com/forum/viewtopic.php?t=25280&start=4

http://www.ccsinfo.com/forum/viewtopic.php?t=27445&highlight=ccspin+pintable+pinn

https://www.ccsinfo.com/forum/viewtopic.php?t=222

http://www.ccsinfo.com/forum/viewtopic.php?t=25280&highlight=ccspin+pintable+pinn


transpose to my job function
but as I'm using a 16F628
and I can not success

Code:
//----------------------------------------------------------------
#include <16f628.h>
#fuses HS,INTRC_IO, NOLVP, NOWDT, PUT
#use delay (clock=4000000)

#define  .... bla bla bla....

 
//int8 pin_table[6]  = {PIN_A2,PIN_A3,PIN_B0,PIN_B1,PIN_B2,PIN_B3};  //my inputs

           int8 leds[6] = {PIN_A1,PIN_A0,PIN_B7,PIN_B6,PIN_B5,PIN_B4}; //my outputs


// ...do_pin_io( )  as  http://www.ccsinfo.com/forum/viewtopic.php?t=25280&start=4


int myfunction_teste(int8 pinn) {

int8 ccs_pin;

ccs_pin = leds[pinn];

do_pin_io(ccs_pin,0);
delay_ms(500);
do_pin_io(ccs_pin,1);

 return 1; }

void main () {

int8 pX; 
for(pX=0;pX<6;pX++) {      myfunction_teste(pX);    }
   
}
//-------------------------------------------------------------
PCWHD Compiler
IDE PCB PCM PCH PCD v 4.114
//-------------------------------------------------------------
in proteus simulation
works only with the first 2 pins of array
thank you for any help

[]´s hw
_________________
[]´s
hw
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Nov 06, 2012 4:15 am     Reply with quote

My advice, get rid of Proteus.

Do a search on this forum to find out what others think of it as a simulator.

Mike
Ttelmah



Joined: 11 Mar 2010
Posts: 19278

View user's profile Send private message

PostPosted: Tue Nov 06, 2012 4:18 am     Reply with quote

As an example of how bad it is, you have two oscillators selected (HS for a high speed external crystal, and INTRC_IO for internal oscillator with the crystal pins used for I/O), yet it doesn't complain......

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 06, 2012 2:02 pm     Reply with quote

Quote:
trying to use the function do_pin_io( ) some doubts

PCB PCM PCH PCD v 4.114

You don't need to use do_pin_io() with your compiler version. do_pin_io()
was for vs. 3.xxx of the compiler. Version 4.xxx allows variables as
parameters for output_low(), output_high(), etc.

Get rid of the do_pin_io() function.
net_hw



Joined: 17 Oct 2012
Posts: 6

View user's profile Send private message

Re: trying to use the function do_pin_io( ) some doubts
PostPosted: Tue Nov 06, 2012 2:43 pm     Reply with quote

Thank you very much for the valuable information

Proteus - I agree with the tip, I had no other simulator, now I evaluating others.

HS together INTRC_IO
OHHHHHHHH!!!!!!
I feel ashamed

that stupid error

in awhile I copied (CTRL + C) a LED blinking somewhere on the net and disseminate the mistake of someone and so has been I've corrected the error now, thanks.


Version 4.xxx Allows the variables
parameters for output_high()

Also thank you very much.

Then the problem should be even with Proteus.
The sensors that are using, is too unstable for proto board.
I'll make a PCB and test it in the real world.

net_hw
_________________
[]´s
hw
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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