PR29

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

Re: PR29

Postby mark » Mon Mar 05, 2012 2:33 pm

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.
mark
Novice
 
Posts: 22
Joined: Mon Feb 13, 2012 12:04 am

Re: PR29

Postby robosang » Mon Mar 05, 2012 3:11 pm

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:
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: PR29

Postby mark » Mon Mar 05, 2012 6:59 pm

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.
mark
Novice
 
Posts: 22
Joined: Mon Feb 13, 2012 12:04 am

Re: PR29

Postby robosang » Mon Mar 05, 2012 8:39 pm

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.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: PR29

Postby mark » Tue Mar 06, 2012 1:51 am

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.
mark
Novice
 
Posts: 22
Joined: Mon Feb 13, 2012 12:04 am

Re: PR29

Postby ABSF » Tue Mar 06, 2012 9:40 am

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
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: PR29

Postby mark » Tue Mar 06, 2012 11:13 am

thanks =) but i asked for extend. i didn't go for presentation.
mark
Novice
 
Posts: 22
Joined: Mon Feb 13, 2012 12:04 am

Re: PR29

Postby robosang » Tue Mar 06, 2012 6:38 pm

:shock: :o
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: PR29

Postby Suria » Sat Mar 31, 2012 6:07 pm

Code: Select all
#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:
Suria
Novice
 
Posts: 24
Joined: Sat Dec 31, 2011 11:21 am

Re: PR29

Postby robosang » Sat Mar 31, 2012 10:51 pm

Why don verify the Microcontroller is working first :) Is there any simple LED blinking verification?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

PreviousNext

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 9 guests

cron