View previous topic :: View next topic |
Author |
Message |
jeeshenlee
Joined: 15 Apr 2011 Posts: 3
|
|
Posted: Fri Apr 15, 2011 11:37 pm |
|
|
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
|
|
Posted: Sat Apr 16, 2011 12:43 am |
|
|
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
|
|
Posted: Sat Apr 16, 2011 1:19 am |
|
|
Alright. Thanks. |
|
|
net_hw
Joined: 17 Oct 2012 Posts: 6
|
trying to use the function do_pin_io( ) some doubts |
Posted: Tue Nov 06, 2012 4:00 am |
|
|
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
|
|
Posted: Tue Nov 06, 2012 4:15 am |
|
|
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: 19504
|
|
Posted: Tue Nov 06, 2012 4:18 am |
|
|
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
|
|
Posted: Tue Nov 06, 2012 2:02 pm |
|
|
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
|
Re: trying to use the function do_pin_io( ) some doubts |
Posted: Tue Nov 06, 2012 2:43 pm |
|
|
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 |
|
|
|