Monday 30 April 2018

How to load hex file into AT89S52

In this post, we will learn how to upload hex file into AT89S52. It's a bit difficult to upload hex file into AT89S52 unlike atmega controllers which use AVRdudes for uploading hex file.

AT89S52 ia 40-pin IC and it has 40 GPIO pins and there are 4 ports viz, PORT 0, 1, 2 and 3. Each port has 8 pins. Total GPIO pins are: 8(pins in each port) * 4 (total number of ports) = 32 gpio pins
PORT0 is pull-up rest of the ports have internal pull-up resistor.

In order to eliminate tri-state condition in 8051 we can use network resistor of 10k (A103J)
It have peripherals like: Timer/ Counters, UART, GPIO programming, interrupt programming, etc. It don't have built-in ADC, SPI, I2C and there is no option of  internal RC oscillator.

It's Machine Cycle (MC) is calculated by: 12/ 11.0592 MHz = 1.085 us

Hardware required:
  • USBasp Programmer
  • AT89S52 development board (either on strip board or bread board)
Software required:
  • Progisp (for dumping hex file)
  • Keil uVision (8051 IDE for programming)
Circuit Diagram:

circuit
Download Progisp: Download

Code for toggling a port:


  #include<reg51.h>

void delay(void)
{
unsigned int a;
  for(a=0;a<20000;a++);
}
void main()
{
P1=0x00;
while(1)
{
P1=0xff;
delay();
P1=0x00;
delay();
}
}


/// Code Ends here

Video:



10 comments:

  1. Greatest News for every currency users, Now you can sell your currency or ethereum funds to receive money.
    ethereum blgospot
    thanks for visit my link

    ReplyDelete
  2. I have properly installed the 64 bit driver for USBasp on Windows10, however Progisp fails to run, it returns programmer not found

    Can somebody help with a solution

    ReplyDelete
  3. bitcoin mobile recharge and top up credits quickly and easily any where in the world. this is a top up phone with bitcoin best telecom mobile network operator worldwide.Every thing we have explained is so simple to understand. We provide you 24 hours service. Many of our clients have actually fixed their bitcoin amount for their mobile credit. If you also do not use your cryptocurrency for any cause as yet then we have told you the best way to utilize your money

    ReplyDelete
  4. One of the top website for organic SEO, where you can easily Drive More Traffic To Website within a month. Yes, it's time to increase your clients/visitors on your website and earn more and more money from your website or business. Visit for more details.
    drive more traffic to website

    ReplyDelete
  5. Our offer is very effective when compared with the listed list. You create a very site and boost your google rankings web site, but this site does not require anyone to use your site. This is the first place for SEO services to allow users to access your site.

    ReplyDelete
  6. Our offer is very effective when compared with the listed list. You create a very site and boost your google rankings web site, but this site does not require anyone to use your site. This is the first place for SEO services to allow users to access your site.

    ReplyDelete
  7. Здравствуйте, дамы Простите что поздно, то я ходила делать мелирование в салон красоты на Пришвина. Приятные мастера, теперь вся довольная и красивая! Дамы, рекомендую!

    ReplyDelete
  8. Доброе время суток! Замечательный блог. Спасибо за то, что разместили. Самые последние информации об окнах из дерева там. Также рекомендую этот сайт: домостроительные анонсы смотри на этом ресурсе.

    ReplyDelete
  9. Привет! Гляньте на справочное издание о используемых лекарственных средств. В путеводитель включены данные о свыше семистах используемых медицинских препаратах, изготавливаемых российскими и иностранными фармкомпаниями. О любом медицинском препарате дана полная инфа: состав и форма выпуска, лечебные свойства, показания к использованию, критерии применения, вероятные побочные эффекты, взаимодействие с алкогольными напитками, противопоказания и взаимодействие другими лекарственными препаратами, также способность использования при грудном вскармливании, беременности. В справочник включен тематический указатель, в каком имеется инфа о том, какое медикаментозное средство нужно использовать при тех или иных синдромах, болезнях, состояниях. Путеводитель можно прочитать на медицинском ресурсе. Не откладывайте визит к доктору! Орфенадрин, Йохимбин, Тинидазол, Оксихлорозен, Кариндациллин, Пропиомазин,

    ReplyDelete
  10. Разыскиваете, на каком производстве заказать деревянные окна? Рекомендуем группу компаний СВ Окна, которая начала работу в 1995 году. Предприятие изготавливает широкий набор деревянных окон и дверей от очень доступных по цене до окон премиум-класса. Даже самый прихотливый покупатель сможет выбрать для себя устраивающие деревянные евроокна. В номенклатуре изделий есть дешевые деревянные окна из сосны, деревянные евроокна, деревянные окна с алюминием, двери-порталы, складные двери.

    ReplyDelete