at89c2051

Status
Not open for further replies.

mstechca

New Member
I am a little lost.

All I wanted to do is perform a ridiculously simple program which outputs some text on the LCD.

I have connected the LCD to port 1 on the at89c2051 chip.

Where on the chip should the LCD's R/S, and E go? and why?

Also, I used a simple common collector amplifier to convert 12V output from the serial port to < 5V so that nothing blows up.

I am using an external oscillator about 900Khz to drive the at89c2051, because I don't have a crystal.

The reset pin is always low.

I connected the serial port data output to the at89c2051's serial data input which to me seems logical.

The 2KB flash rom is empty, and I dont think that should have anything to do with it because my PC is sending the instructions.

Do I have to fine tune the clocks to use the serial port?
 
I can't help you much specifically on the at89c2051, but no where in your message do you mention writing a program for the device - it will do nothing unless you program it (correctly!).

Also, the serial port is completely dependent on the clock speed, you need to initialise the UART for the exact clock speed you use.
 
Let's say I use a parallel port to transfer data from the computer to the chip. Can the program load this way, or does the flash memory need to be programmed first?

I just want a simple way to test the chip.
 
mstechca said:
Let's say I use a parallel port to transfer data from the computer to the chip. Can the program load this way, or does the flash memory need to be programmed first?

I just want a simple way to test the chip.
You have to have some sort of BootLoader Routine in the MCU, you can't just connect it to the Paralel Port or Serial Port and "Expect" it to work...
 
Let's just say I happen to program the flash memory of the chip. As soon as the chip become active, does the code just run at the beginning from address 0?

and what exactly is a bootloader routine?
 
mstechca said:
Let's just say I happen to program the flash memory of the chip. As soon as the chip become active, does the code just run at the beginning from address 0?

and what exactly is a bootloader routine?
Let me ask you something, have you tried Flashing LEDs before? This sounds stupid, but you have to crawl, before you walk...

Usually programs start at 0 position, but it depends from MCU to MCU... Bootloader is a peace of code, that runs on startup of the MCU, and checks if there is any demand to enter any special mode (eg the MCU is Called to enter Programming mode...), if not, it continues to execute normal program instead...
 
I am still lost with this boot loader thing,

and yes, I can flash LED's using discrete components.

This is actually the very first time I am using a microcontroller.

The reason why I am using at89c2051 over any other device is because it has only 20 pins, allowing me to make more compact projects.

EDIT: I just looked at your bootloader site. Is a bootloader really necessary? if so why, when I could just start executing code at position 0?
 
Holy Crap, First you have to know how to Flash LEDs using the 2051!!! :twisted: Forget about the Bootloader, Serial or Paralel connctions! If you never programed the 2051, Please look for Tutorials for 2051!
 
I have an Idea, Dump the 2051 Idea and Switch to PIC. PICs are much more flexibile to use and Many people in this forum Can help you.

Follow these steps:

1. Go to the Shop and Buy PIC 16F628A Chip

2. Read the Sticky about PICs: https://www.electro-tech-online.com/threads/circuit-impedance-loading.15292/

3. Build yourself suitable PIC programmer according to Sticky

4. Download Datasheet of 16F628 from www.microchip.com

5. Ask us If you don't understand something.
 
I think I got my code to work now thanks to one user and one website. The only concern (maybe not a problem) is that I am getting 3 types of output. A logic high, a logic low, and an in-between output where the LED is 1/2 lit. I think it is normal because of the internal pull-up resistors inside the chip, but I'm not 100% sure.
 
mstechca said:
The reason why I am using at89c2051 over any other device is because it has only 20 pins, allowing me to make more compact projects.

Poor choice! - on all fronts!. It's a more complicated chip than a PIC, and it's LARGER than a PIC!. PIC's are by far the most popular processor for hobby use, and with good reason!.

A PIC 16F628 is only 18 pin, yet gives 16 I/O pins - I suspect this gives more I/O than the at89c2051 with two less pins?.
 
Jay.slovak said:
I have an Idea, Dump the 2051 Idea and Switch to PIC. PICs are much more flexibile to use and Many people in this forum Can help you.

how are PICs much more flexible then atmels?
 
OK, let's take 16F88 PIC and compare it to 2051...

Advantages of PIC: 18PIN package, where 16I/Os possible (Versus Atmels 20PIN with only 15 I/Os!). Data EEPROM Memmory, CCP/PWM module, A2D, USART with wide speed selections (ATMELs UART requiers One Timer for it's function), 3 Independant Timers, Ability to Read/Write Into program memory... and mamy more (Plus cool MPLAB, graphical IDE)...

PICs are way more Flexibile then OLD 2051...


And great Internet support (like this forum)
 

He picked a really crappy atmel chip to play around with though, you can easily say the 16F88 is more flexible then 2051, i wouldn't make the generalized statement that pics are more flexible then atmels though.

everyone in the PIC world seems to have a particular PIC they favor and use for all projects, big or small (unless they run into problems and need to upgrade), for example, i bet you use the 16F88 whenever and wherever for your hobby projects, even if it's something as simply as flashing LEDs, or if it's something more complicated like driving an LCD.

I use the ATMega8's for pretty much every hobby related project I do, which would be a closr match to the 16F88. For larger things I use the ATMega16, and going up from there is easy to do...

Point is, it's a preference, nothing more. The only real advantage I can see for PICs, is the great user support you've already mentioned.
 
I was generaly talking about 2051. ATMEL AVR's are pretty good chips!

And Yes, I use PIC for everything (eg. to replace 555), they are universal and it's cheap to buy them if you take a whole Bag, so you can use them as universal IC.
 
Jay.slovak said:
I was generaly talking about 2051. ATMEL AVR's are pretty good chips!

And Yes, I use PIC for everything (eg. to replace 555), they are universal and it's cheap to buy them if you take a whole Bag, so you can use them as universal IC.

Yea, unfortantly that can be kind of a handicap. All of us microcontroller buffs, whenever presented with a problem, easily solve it with a 3$ uC and a bit of code instead of trying discrete components or IC's...

I'm no better though, I do the exact same thing for my hobby type stuff :wink:
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…