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
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!!!
 

check TrisX
Mclr
and post ur code if this dont resolve ur problem
 

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.
 

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

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
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)
 

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

Back
Top