Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

can check for me what wrong with my programming? cannot run in mikroC PRO

Status
Not open for further replies.

lazyhut

Member level 1
Joined
Feb 14, 2011
Messages
33
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,467
can check for me what wrong with my programming? cannot run in mikroC PRO
No reaction when i pressed the switch..it suppose will display in LCD..
can you check my coding uploaded? The coding cannot run in mikroC PRO
THANKS..

IC:pIC16F877A
compiler:MikroC PRO 3.2

download:
View attachment test.txt
 
Last edited:

john blue

Advanced Member level 3
Joined
Jun 7, 2007
Messages
821
Helped
213
Reputation
430
Reaction score
204
Trophy points
1,323
Activity points
4,749
instead of #define, try using the port directly :)
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,020
Reputation
4,156
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
I think tou need to read AVR GCC Tutorial (1) – Basic I/O Operations « Suhas’s Blog
You are using PORTA to read the input state (smoke) of the pin , this in not correct, the input register is PINA, PINB...
The PORTA sets the pull-up resistor when the pin is set as input.
The above article explains everything.

instead of #define, try using the port directly :)
What is wrong with using define?

Alex

---------- Post added at 15:46 ---------- Previous post was at 15:30 ----------

Sorry , I think you are using PIC, if this is the case ignore what I wrote, they are valid for AVR mcu.
You should include in your message the mcu you are using.

Alex
 

lazyhut

Member level 1
Joined
Feb 14, 2011
Messages
33
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,467
I think tou need to read AVR GCC Tutorial (1) – Basic I/O Operations « Suhas’s Blog
You are using PORTA to read the input state (smoke) of the pin , this in not correct, the input register is PINA, PINB...
The PORTA sets the pull-up resistor when the pin is set as input.
The above article explains everything.


What is wrong with using define?

Alex

---------- Post added at 15:46 ---------- Previous post was at 15:30 ----------

Sorry , I think you are using PIC, if this is the case ignore what I wrote, they are valid for AVR mcu.
You should include in your message the mcu you are using.

Alex

sorry about that, i dint mention clearly..im using PIC16F877A.
 

demetal

Full Member level 5
Joined
May 2, 2011
Messages
275
Helped
21
Reputation
42
Reaction score
21
Trophy points
1,298
Location
Kingdom Of Kochi
Activity points
3,173
can check for me what wrong with my programming? cannot run in mikroC PRO
No reaction when i pressed the switch..it suppose will display in LCD..
can you check my coding uploaded? The coding cannot run in mikroC PRO
THANKS..

IC:pIC16F877A
compiler:MikroC PRO 3.2

download:
View attachment 56505

your program has been compiled in mikroC pro and it is displaying initial lcd strings (i.e; testing and 0...9).... i didnt check the subroutine... but i think the term shown below can cause a run time error.....

void setting()
{
while(sw1); //no semicolon required
{ // add braces at starting and close at end as you are considering a case i,e; when sw1 is pressed do so...
Delay_ms(100);
lcd_out(1,1,"Setting Number1 ");
x=0x30;
counter=1;
.........................
.............
.........;

similarly check other subroutines ..... if your compiler mikro C doesn't run this try reinstalling it...
 

lazyhut

Member level 1
Joined
Feb 14, 2011
Messages
33
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,467
your program has been compiled in mikroC pro and it is displaying initial lcd strings (i.e; testing and 0...9).... i didnt check the subroutine... but i think the term shown below can cause a run time error.....

void setting()
{
while(sw1); //no semicolon required
{ // add braces at starting and close at end as you are considering a case i,e; when sw1 is pressed do so...
Delay_ms(100);
lcd_out(1,1,"Setting Number1 ");
x=0x30;
counter=1;
.........................
.............
.........;

similarly check other subroutines ..... if your compiler mikro C doesn't run this try reinstalling it...
but i replace while(!sw1) it will shown in lcd display..zzz
 

E-design

Advanced Member level 5
Joined
Jun 1, 2002
Messages
2,014
Helped
507
Reputation
1,016
Reaction score
407
Trophy points
1,363
Activity points
14,195
This must be set to define input type Analog or Digital



---------- Post added at 16:11 ---------- Previous post was at 15:59 ----------

On the A it may be controlled via ADCON1 and/or CMCON
 

lazyhut

Member level 1
Joined
Feb 14, 2011
Messages
33
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,467
This must be set to define input type Analog or Digital



---------- Post added at 16:11 ---------- Previous post was at 15:59 ----------

On the A it may be controlled via ADCON1 and/or CMCON
it is work with adding ADCON1..thanks
 
Last edited:

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top