Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

about Hi-Tech PicC-lite

Status
Not open for further replies.

bjerkely

Member level 4
Member level 4
Joined
May 26, 2004
Messages
72
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Turkiye
Activity points
589
I'm currently using Hi-Tech PicC-lite , I compile my code with no error and use Proteus as simulator and they all work, everything is so fine in theory but when I try the same code in a circuit on bread board nothing seems to work,I can't even blink a LED .But When I use assembly instead of C , I get the LED blinking.

I can't guess the problem!!!
 

Cortex

Full Member level 3
Full Member level 3
Joined
Mar 26, 2005
Messages
182
Helped
12
Reputation
24
Reaction score
4
Trophy points
1,298
Location
Morocco
Activity points
2,733
check TrisX
Mclr
and post ur code if this dont resolve ur problem
 

Davood Amerion

Advanced Member level 2
Advanced Member level 2
Joined
Mar 1, 2005
Messages
579
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
Errorless compiling does not mean your code is correct!
you may forgot something. or dont initialize correctly.
if you post your code we can help you better.
 

bjerkely

Member level 4
Member level 4
Joined
May 26, 2004
Messages
72
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Turkiye
Activity points
589
I just tried the code below on board,led on RB1 in continually ON,it's not blinking.

#include <pic.h>
#include <delay.h>
#include <delay.c>

unsigned char i;
void main(void){
TRISB=0;

for(i=20 ; i>=0;--i){
RB1=1;
DelayMs(500); /*500ms delay*/
RB1=0;
DelayMs(500);
}
while(1){}
}

Thanx in advance...
 

Davood Amerion

Advanced Member level 2
Advanced Member level 2
Joined
Mar 1, 2005
Messages
579
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
Hi bjerkely,
First:
DelayMs(unsigned char) get integer not grater than 255
you can try two of them with value 250.

Second:
in your code you do not define microcontroller (for examle)
#define _16F877

Third:
I dont remember how RB1 (RBx) used, so
i suggest try using " PORTB = 0x02; " instead of " RB1 = 1 "

Regards,
داود عامریون
 

    bjerkely

    Points: 2
    Helpful Answer Positive Rating

bjerkely

Member level 4
Member level 4
Joined
May 26, 2004
Messages
72
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Turkiye
Activity points
589
Thank you Davood. I'll try again with remarks in hand...Besides how can I define the crystal or the exact configuration word ??
( __config _XT_OSC & _WDT_OFF & _PWRTE_OFF)
 

rfmw

Advanced Member level 2
Advanced Member level 2
Joined
May 10, 2001
Messages
543
Helped
93
Reputation
190
Reaction score
51
Trophy points
1,308
Activity points
3,978
check that your oscillator is running. If you didn't change default clock frequency setting, you should have 4MHz crystal for 500Ms to be correct
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top