Page 4 of 5

Re: PR29

PostPosted: Mon Mar 05, 2012 2:33 pm
by mark
i called up and he asked me to compile the file using the method given in the guide. i'll try it out and see if it solve the problem. i don't have time to send it back to cytron. my presentation is tomorrow.

Re: PR29

PostPosted: Mon Mar 05, 2012 3:11 pm
by robosang
Why don just try the hex code they provide? I think they have the hex code in their example code right? I am sure they verify the code before they post it up.

If you do your own hardware, you will need to troubleshoot it. Everyone will say they follow exact the same, but end up a lot of differences can be spotted. :mrgreen:

Re: PR29

PostPosted: Mon Mar 05, 2012 6:59 pm
by mark
i've been using their hex file all the while. i actually misunderstood what he say. he wants me to program it using UIC00B instead of the one i'm using in my college.

Re: PR29

PostPosted: Mon Mar 05, 2012 8:39 pm
by robosang
Er? So you mean your college programmer cannot load program? I thought previous you have successfully have message on LCD? It kind of weird because hex file is the lowest level code, it does not depends on programmer or compiler. If same hex code, successfully loaded into to microcontroller, should act the same.

Re: PR29

PostPosted: Tue Mar 06, 2012 1:51 am
by mark
I dont know why but when I fixed it on the breadboard, "Cytron Tech, PR29" appeared and then disappeared. That is where it stopped. I was running out of time, so I just proceed with the pcb thinking that at least there is display already. But it ended up not working on the pcb that I made (due to some error). So, i tried fixing it on the pcb given by cytron, it didn't work either. I've already use 3 ICs. Changed 3 LCDs. Changed the crystal too but still its not functioning.

Re: PR29

PostPosted: Tue Mar 06, 2012 9:40 am
by ABSF
What you lack is *Experience that will take you YEARS to gain. Sometimes the fault is obvious but you wouldnt be able to see it due to lack of *. Using Breadboard, the fault can be a wire which is intermittent (bad soldering at pin) or a component with oxydized legs. But I cannot understand why it cant work with the cytron PCB. I guess the problem should be obvious with experienced eyes.

Good luck with your presentation. ;)

Allen

Re: PR29

PostPosted: Tue Mar 06, 2012 11:13 am
by mark
thanks =) but i asked for extend. i didn't go for presentation.

Re: PR29

PostPosted: Tue Mar 06, 2012 6:38 pm
by robosang
:shock: :o

Re: PR29

PostPosted: Sat Mar 31, 2012 6:07 pm
by Suria
CODE: SELECT_ALL_CODE
#include <htc.h>
#include <pic.h>

__CONFIG ( 0x3F32 );
   
#define rs         RC4
#define e          RC5
#define lcd_data   PORTB

void send_config(unsigned char data);
void delay(unsigned long data);
void send_string(const char *s);
void lcd_clr(void);
void lcd_goto(unsigned char data);
void send_char(unsigned char data);

unsigned char location=1;

void main(void)
{
   TRISB = 0b00000000;
   TRISC = 0b10000000;

   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);         //display on, cursor off and cursor blink off
   send_config(0b00111000);         //function set
   
   lcd_clr();
   lcd_goto(0);
   send_string("ND2/11/CME");
   lcd_goto(20);
   send_string("MKJB");
   delay(200000);
   lcd_clr();
   
}

void send_config(unsigned char data)
{
      rs=0;
      lcd_data = data;
      e=1;
      delay(50);
      e=0;
      delay(50);
}
   
void lcd_clr(void)
{
   send_config(0x01);
   delay(600);
}   

void delay(unsigned long data)
{
   for( ;data>0;data--);
}

void lcd_goto(unsigned char data)      //set the location of the lcd cursor
{                              //if the given value is (0-15) the
    if(data<16)                     //cursor will be at the upper line
   {                           //if the given value is (20-35) the
       send_config(0x80+data);         //cursor will be at the lower line
   }                           //location of the lcd cursor(2X16):
   else                        // -----------------------------------------------------
   {                           // | |00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15| |
       data=data-20;               // | |20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35| |
      send_config(0xc0+data);         // -----------------------------------------------------   
   }
}

void send_string(const char *s)         //send a string to display in the lcd
{         
   unsigned char i=0;
     while (s && *s)send_char (*s++);
}

void send_char(unsigned char data)      //send lcd character
{
   rs=1;                        //set lcd to display mode
   lcd_data=data;                  //lcd data port = data
   e=1;                        //pulse e to confirm the data
   delay(10);
   e=0;
   delay(10);
}


here is my code to test the LCD. is it okay? could someone help me? :cry:

Re: PR29

PostPosted: Sat Mar 31, 2012 10:51 pm
by robosang
Why don verify the Microcontroller is working first :) Is there any simple LED blinking verification?