PR 11 Temperature Control System..

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

PR 11 Temperature Control System..

Postby ONG WEI GIAP » Thu Nov 17, 2011 7:02 am

i have done all the soldering. when i swticth on the circuit, the LCD and led(greed) light up but nothing is show in LCD. may i know how to solve this problem? besides, when i connect UIC00B to the cicuit and my laptop, MPLAB IDE shown BUILD SUCCESSFUL.. but when i use PICkit2 to read, it shown no devices is detected. i have to solve this problem urgently for presentation purpose. i am really highly appreciate the guilding for me to success running this system.
ONG WEI GIAP
Freshie
 
Posts: 5
Joined: Wed Nov 02, 2011 3:46 pm

Re: PR 11 Temperature Control System..

Postby shahrul » Thu Nov 17, 2011 9:55 am

Did you switch ON the circuit while connecting to software?
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR 11 Temperature Control System..

Postby ONG WEI GIAP » Thu Nov 17, 2011 5:17 pm

yes, i did. i even try wif the ICSP programmer socket. it also can detect the PIC chip.. i have bought 3 DIY project, 3 of the PIC chip having the same problem..
ONG WEI GIAP
Freshie
 
Posts: 5
Joined: Wed Nov 02, 2011 3:46 pm

Re: PR 11 Temperature Control System..

Postby robosang » Thu Nov 17, 2011 6:00 pm

ONG WEI GIAP WROTE:yes, i did. i even try wif the ICSP programmer socket. it also can detect the PIC chip.. i have bought 3 DIY project, 3 of the PIC chip having the same problem..


Can or Can't detect? If can detect with ICSP programmer socket ( I am assuming UIC-S), it means your PCB have problem.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: PR 11 Temperature Control System..

Postby ONG WEI GIAP » Thu Nov 17, 2011 6:27 pm

sorry.. is cant ..
ONG WEI GIAP
Freshie
 
Posts: 5
Joined: Wed Nov 02, 2011 3:46 pm

Re: PR 11 Temperature Control System..

Postby ober » Fri Nov 18, 2011 9:43 am

Hi, all DIY project circuit, PCB and sample source code is being tested before we launched the particular DIY set. And for PR11, many have did it with success.

It might be polarity ? Anyway, please can you capture a photo of PCB board, top and bottom? Also with UIC00B connected.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: PR 11 Temperature Control System..

Postby zhenning » Wed Nov 23, 2011 4:56 pm

ONG WEI GIAP WROTE:i have done all the soldering. when i swticth on the circuit, the LCD and led(greed) light up but nothing is show in LCD. may i know how to solve this problem? besides, when i connect UIC00B to the cicuit and my laptop, MPLAB IDE shown BUILD SUCCESSFUL.. but when i use PICkit2 to read, it shown no devices is detected. i have to solve this problem urgently for presentation purpose. i am really highly appreciate the guilding for me to success running this system.



you might installed the wrong components on the wrong side or some of your solders did not actually connect or your solders too much until other pins are connected as well =)
zhenning
Enthusiast
 
Posts: 351
Joined: Thu Dec 30, 2010 12:32 am

Re: PR 11 Temperature Control System..

Postby ABSF » Wed Nov 23, 2011 7:03 pm

ONG WEI GIAP WROTE:i have done all the soldering. when i swticth on the circuit, the LCD and led(greed) light up but nothing is show in LCD. may i know how to solve this problem? besides, when i connect UIC00B to the cicuit and my laptop, MPLAB IDE shown BUILD SUCCESSFUL.. but when i use PICkit2 to read, it shown no devices is detected. i have to solve this problem urgently for presentation purpose. i am really highly appreciate the guilding for me to success running this system.


From your descriptions, you have 2 programmers:UIC00B and PICkit2 right? You are programming your PR11 using UIC00B through the 10 pin socket and you got programming successful. But when you read it with the PICkit2, you get "Device Not Detected".

May I know how you program your PIC chip? Did you try to program it with the program that comes with the mini CD included with the UIC00B? I guess your target code was not properly burnt into the chip. As for your PICkit2, I guess it is faulty. Did you try to verify another PIC chip from your friend.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: PR 11 Temperature Control System..

Postby Tianjin » Thu Dec 20, 2012 11:45 am

ober WROTE:Hi, all DIY project circuit, PCB and sample source code is being tested before we launched the particular DIY set. And for PR11, many have did it with success.

It might be polarity ? Anyway, please can you capture a photo of PCB board, top and bottom? Also with UIC00B connected.
Tianjin
Novice
 
Posts: 19
Joined: Mon Dec 10, 2012 1:01 am

Re: PR 11 Temperature Control System..

Postby Tianjin » Thu Dec 20, 2012 11:49 am

Hey, I have bought ICD2 and PIC18f4520 module and when I tried to test temperature control program on Cytron DIY project,my LCD doesn't display any thing.
I reprogrammed the code like this below, pls, look at it and tell me my problem. It's compiled successfully and it works on protues simulation.
CODE: SELECT_ALL_CODE
//==================include=================================

#include <p18f4520.h>
#include <delays.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//===============define IO port=============================
#define      lcd        PORTD   //edited
#define      RS        RA2
#define      E        RA5
#define      CHANNEL0     0b00000001   // AN0
#define      CHANNEL1     0b00000101   // AN1
#define      buzzer     RC5
#define      fanA        RC4
#define      fanB        RC3
#define      ledA        RC2
#define      ledB        RC1

unsigned short result;
unsigned short temp,tempA,tempB;

//==============FUNCTION PTOTOTYPE=========================
void e_pulse(void);
void delay(unsigned short i);
void send_char(unsigned char data);
void send_config(unsigned char data);
void lcd_goto(unsigned char data);
void lcd_clr(void);
void dis_num(unsigned long data);
void increment(unsigned long data);
void read_adc(void);
unsigned short read_temp(void);

//====================MAIN================================

void main(void)
{
   ADRESH=0;               //clear A/D result
   ADRESL=0;               //clear A/D result
                
   ADCON1 = 0b00111101;   // configure RA2 and RA5 as digital I/O
   ADCON2 = 0b10001110;   //// Set result right justified, manual acquisition time, Fosc/4

   TRISA=0b11011011;         //configure PORTA I/O direction
   TRISB=0b00000000;         //configure PORTB as output
   TRISC=0b00000000;                //configure PORTC as output//edited
   TRISD=0b00000011;      //configure PORTD I/O direction
   PORTA=0;
   PORTC=0;
   
   while(1)               
   {
      send_config(0b00000001);      //clear display at lcd
      send_config(0b00000010);      //Lcd Return to home
      send_config(0b00000110);      //entry mode-cursor increase 1
      send_config(0b00001100);      //diplay on, cursor off and cursor blink off
      send_config(0b00111000);      //function set
      
      lcd_goto(0);               //cursor start from beginning
      
      //display character on LCD
      send_char('T ');
      send_char('E ');
      send_char('M');
      send_char('P');
      send_char('.');
      send_char('A');
      send_char('.');
      send_char('=');   

      lcd_goto(20);               //cursor go to 2nd line of the LCD

      //display character on LCD
   send_char('T ');
      send_char('E ');
      send_char('M');
      send_char('P');
      send_char('.');
      send_char('B');
      send_char('.');
      send_char('=');   


      while(1)                  //infinity loop
      {
      //sensor A
      ADCON0=CHANNEL0;            //CHANNEL1=0b10001001
      lcd_goto(8);
            
      read_adc();

      temp=read_temp();
      dis_num(temp/10);
      send_char('.');
      dis_num(temp%10);
      send_char(0b11011111);
      send_char('C');
      send_char(' ');
      send_char(' ');
      
      tempA=temp;
      
      //sensor B
      ADCON0=CHANNEL1;            //CHANNEL0=0b10000001         

      lcd_goto(28);
            
      read_adc();

      temp=read_temp();
      dis_num(temp/10);
      send_char('.');
      dis_num(temp%10);
      send_char(0b11011111);
      send_char('C');
      send_char(' ');
      send_char(' ');

      tempB=temp;
   
         if((tempA>=350)&&(tempB<400))      
//   ************************************************************************************************
            {                        
//   *   LED A and Fan A activated only for    *
               PORTCbits.RC2=1;//ledA=1;                  
//   *   temperature A greater than 40'C      *
               PORTCbits.RC1=0;//ledB=0;                  
//   *   and temperature B less than 35'C   *
               PORTCbits.RC4=0;//fanA=1;                  
//   *****************************************
               PORTCbits.RC3=1;//fanB=0;COOLER FAN'LL BE ON
               PORTCbits.RC5=0;//buzzer=0;
              
            }   
   else if((tempA>=200) && (tempB<350))
      
//   *****************************************
            {                        
//   *   LED B and Fan B activated only for    *
               PORTCbits.RC2=0;//ledA=0;                  
//   *   temperature A less than 40'C and   *
               PORTCbits.RC1=1;//ledB=1;                  
//   *   temperature B greater than 35'C      *
               PORTCbits.RC4=1;//fanA=0;HEATER FAN'LL BE ON                  
//   ********************************************
               PORTCbits.RC3=0;//fanB=1;
               PORTCbits.RC5=0;//buzzer=0;
               
               }   


         else    
//   *****************************************************
            {
//   *All LED A & LED B, Fan A & Fan B and Buzzer      *
               PORTCbits.RC1=0;//ledB=0;   
//*disactivated for temperature  less than 40'C   *
               PORTCbits.RC2=0;//ledA=0;   
//*and temperature greater than 30'C            *
               PORTCbits.RC4=0;//fanA=0;                  
//   *****************************************************
               PORTCbits.RC3=0;//fanB=0;
               PORTCbits.RC5=0;//buzzer=0;
   
            }
   
      }
//==================subroutine LCD setting ==========================
}
}
void send_config(unsigned char data)
{
    PORTAbits.RA2=0;//RS=0;
   lcd=data;
   delay(500);
   e_pulse();
}

void e_pulse(void)
{
   PORTAbits.RA5=1;//E=1;
   delay(500);
   PORTAbits.RA5=0;//E=0;
   delay(500);
}

void send_char(unsigned char data)
{
    PORTAbits.RA2=1;//RS=1;
   lcd=data;
   delay(500);
   e_pulse();
}


void lcd_goto(unsigned char data)
{
    if(data<16)
   {
       send_config(0x80+data);
   }
   else
   {
       data=data-20;
      send_config(0xc0+data);
   }
}


void lcd_clr(void)
{
   PORTAbits.RA2=0;//RS=0;
    send_config(0x01);
   delay(600);   
}


void dis_num(unsigned long data)
{
   unsigned char hundred_thousand;
   unsigned char ten_thousand;
   unsigned char thousand;
   unsigned char hundred;
   unsigned char tenth;

   hundred_thousand = data/100000;               
   data = data % 100000;
   ten_thousand = data/10000;
   data = data % 10000;
   thousand = data / 1000;
   data = data % 1000;
   hundred = data / 100;
   data = data % 100;
   tenth = data / 10;
   data = data % 10;

   if(hundred_thousand>0)
   {
      send_char(hundred_thousand + 0x30);   //0x30 added to become ASCII code
      send_char(ten_thousand + 0x30);
      send_char(thousand + 0x30);
      send_char(hundred + 0x30);
      send_char(tenth + 0x30);
      send_char(data + 0x30);
   }

   else if(ten_thousand>0)
   {
      send_char(ten_thousand + 0x30);   //0x30 added to become ASCII code
      send_char(thousand + 0x30);
      send_char(hundred + 0x30);
      send_char(tenth + 0x30);
      send_char(data + 0x30);
   }
   else if(thousand>0)
   {
       send_char(thousand + 0x30);   //0x30 added to become ASCII code
      send_char(hundred + 0x30);
      send_char(tenth + 0x30);
      send_char(data + 0x30);
   }
   else if(hundred>0)
   {
       send_char(hundred + 0x30);   //0x30 added to become ASCII code
      send_char(tenth + 0x30);
      send_char(data + 0x30);
   }
   else if(tenth>0)
    {
      send_char(tenth + 0x30);   //0x30 added to become ASCII code
      send_char(data + 0x30);
   }
   else send_char(data + 0x30);   //0x30 added to become ASCII code
}

void increment(unsigned long data)
{   
   unsigned short j;
   for(j=10;j>0;j--)
   {   lcd_goto(32);
      data=data+1;
      dis_num(data);
      delay(10000);
   }

}

//==================subroutine ADC=========================

void read_adc(void)
{
   unsigned short i;
   unsigned long result_temp=0;
   for(i=2000;i>0;i-=1)         //looping 2000 times for getting average value
   {
      //ADGO = 1;            //ADGO is the bit 2 of the ADCON0 register
      //while(ADGO==1);         //ADC start, ADGO=0 after finish ADC progress
      ADCON0bits.GO = 1;      // Start ADC
      while(ADCON0bits.DONE);   // ADC completed?

      result=ADRESH;
      result=result<<8;         //shift to left for 8 bit
      result=result|ADRESL;      //10 bit result from ADC

      result_temp+=result;      
   }
   result = result_temp/1000;      //getting average value

}

unsigned short read_temp(void)
{
   unsigned short temp;
   temp=result;
   return temp;

}
Tianjin
Novice
 
Posts: 19
Joined: Mon Dec 10, 2012 1:01 am

Next

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 11 guests

cron