![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
panayara
Joined: 07 Dec 2010 Posts: 1
|
PIC16F877A Based Diode Tester in CCS C |
Posted: Tue Dec 07, 2010 7:23 am |
|
|
Hello
Code for Diode tester
Code: | /*Diode Tester Written By Shibu.V www.keralalinux.com and
www.zerovolt.com. Diode can be connect in any direction,
Port used are PB0 and PB1 Processor PIC16F877A*/
#include <16F877A.h>
#device adc=8
#FUSES NOWDT,HS,NOPROTECT
#use delay(clock=20000000)
#include <lcd.c>
#define testpin1 PIN_B0
#define testpin2 PIN_B1
void main()
{
unsigned int test1=0,test2=0;
//Test Diode
lcd_init();
Lcd_gotoxy(1,1);
Lcd_Putc("Diode Test");
output_high(testpin1);
test1=input(testpin2);
output_low(testpin1);
output_high(testpin2);
test2=input(testpin1);
if((test1==1) && (test2==1)){
Lcd_gotoxy(1,2);
Lcd_Putc("Short");}
if((test1==0) && (test2==1)){
Lcd_gotoxy(1,2);
Lcd_Putc("Good");
}
if((test1==1) && (test2==0)){
Lcd_gotoxy(1,2);
Lcd_Putc("Good");
}
if((test1==0) && (test2==0)){
Lcd_gotoxy(1,2);
Lcd_Putc("open");
}
delay_ms(1000);
}
|
See the Circuit and working code download at
http://www.keralalinux.com/2010/12/04/pic16f877a-based-diode-tester-in-ccs-c.html |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Tue Dec 07, 2010 8:49 am |
|
|
It's nice to see a useful, interesting project !
Simple in concept,easy to follow and it WORKS!
I can see the next version using the ADC section to read the voltages on the cathode and anodes,taking the difference and computing whether it's a schottky,power or LED that is being tested.Even the colour of the LED being tested could be figured out!
Good work. |
|
![](templates/subSilver/images/spacer.gif) |
dbotkin
Joined: 08 Sep 2003 Posts: 197 Location: Omaha NE USA
|
|
Posted: Tue Dec 07, 2010 9:31 am |
|
|
Nice. :) I like temtronic's idea too, determining the type of diode (and Zener voltage, if applicable).
As for LED color... that should be pretty easy to determine visually while testing is in progress. :) Although, maybe it would be useful for people who are red/green color blind! |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|