ide wont accept hex file of kiel

Discussion in 'Programmer's Corner' started by corefinder, Feb 7, 2014.

  1. corefinder

    Thread Starter Member

    Oct 6, 2011
    55
    0
    Hi I was working with interfacing of lcd(JHD162a) 16*2 type with at89s52 micro controller. So I tried making program in keil c51 compiler. I compiled the code and generated hex file from it. I tested hex file in proteus simulator and it was running fine, lcd was showing data. I have 8051 Ide bought. It has a usb ISP programmer. But the IDE wont take the hex file. It does not load the hex file by only keil. It would load correctly the hex file of compiler microC pro of 8051 but it wont run on lcd.
     
  2. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
    Have you a link to the IDE you purchased.... The hex file could be the wrong format.... You can get convertor files... I need to see your hex file...
     
  3. corefinder

    Thread Starter Member

    Oct 6, 2011
    55
    0
    Program code:
    Code ( (Unknown Language)):
    1.  
    2. #include<reg52.h> //including sfr registers for ports of the controller
    3. #include<lcd.h> //Can be download from bottom of this article
    4.  
    5. //LCD Module Connections
    6. sbit RS = P2^0;
    7. sbit EN = P2^1;
    8. sbit D4 = P2^4;
    9. sbit D5 = P2^5;
    10. sbit D6 = P2^6;
    11. sbit D7 = P2^7;
    12. //End LCD Module Connections
    13. void Delay(int a)
    14. {
    15.   int j;
    16.   int i;
    17.   for(i=0;i<a;i++)
    18.   {
    19.     for(j=0;j<100;j++)
    20.     {
    21.     }
    22.   }
    23. }
    24. void main()
    25. {
    26.   int i;
    27.   Lcd4_Init();
    28.   while(1)
    29.   {
    30.     Lcd4_Set_Cursor(1,1);
    31.     Lcd4_Write_String("electroSome LCD Hello World");
    32.     for(i=0;i<15;i++)
    33.     {
    34.       Delay(1000);
    35.       Lcd4_Shift_Left();
    36.     }
    37.     for(i=0;i<15;i++)
    38.     {
    39.       Delay(1000);
    40.       Lcd4_Shift_Right();
    41.     }
    42.     Lcd4_Clear();
    43.     Lcd4_Set_Cursor(2,1);
    44.     Lcd4_Write_Char('e');
    45.     Lcd4_Write_Char('S');
    46.     Delay(2000);
    47.   }
    48. }
    49.  
     
  4. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
    Definitely a hex file...

    Where's the link to your programming IDE? I need to know what it needs to receive..
     
  5. corefinder

    Thread Starter Member

    Oct 6, 2011
    55
    0
  6. corefinder

    Thread Starter Member

    Oct 6, 2011
    55
    0
    here is another hex file that burn perfectly. But this hex file was created by MicroC pro compiler.
     
    • lcd.hex
      File size:
      2.2 KB
      Views:
      14
  7. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
    They are both genuine hex files... However I think the issue is in the keil compiler.

    The addresses used on the kiel compiler are very high..... Whereas the microc start were I'd expect!!
     
  8. corefinder

    Thread Starter Member

    Oct 6, 2011
    55
    0
    I dont understand this. Actually the bigger problem is that the hex file by microc is running ok in proteus and also burning on microcontroller but i dont see anything on lcd. So I dont if the problem is in lcd or the code so I thought of using keil to check if something is displayed on lcd.
    I want to know another thing that hex code by micro c is running perfectly on simulator,i.e, lcd is displaying but actual lcd is blank? What could be the reason?
     
  9. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
    After disassembling the mikroC example D4~7 are on pins P2.2 ~ P2.5... Where you are using P2.4 ~ P2.7...

    See if you have options to make 16 bit or 8 bit hex files....
     
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    The HUGE advantage of buying s development board such as yours means you can assume the hardware is correct.

    Sure, anyone can ship a dog on occasion, but the odds are in your favor here.

    A simulator cannot check everything, timing is usually one of those things. Your real hardware may be running much fasted then the simulation so the LCD never has time to respond. I don't use those micros, but with other types you can completely mess up certain configuration settings that a simulator cannot simulate so your code seems to work but...

    I'd advise taking a step back: getting a full LCD to work is tough so do something simple and easy first like get a LED to blink on and off: it's a great hardware check and confidence builder.
     
Loading...