Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

got some boards with AT89C2051, where to start?

Status
Not open for further replies.

panic mode

Well-Known Member
Hi everyone,

I've been using few different MCUs but never Atmel or 8051.
I've been handed couple of simple display boards which use AT89C2051 as controller.
What do i need to get started right away? What software and what hardware?
Pins 6 and 9 of MCU are accessible on a connector.


more details if you are interested:
bard schematics is here
https://www.electro-tech-online.com/custompdfs/2011/07/Schematic20-204X7SEGMENT.pdf
units are not programmed. i'd prefer C but ASM will should do too.
All i need is receive message (RS485) and drive display. driving display is dead simple (4x 74HC595 and ULN2803), getting serial to work should not be much trouble either (one RS232 port is integrated with MAX232; RS422/485 ic sockets are empty since optional, i am waiting for 75156 chips to plug them in)
 
ok, found the chip on Atmel website, downloaded IDE (AT89LP) so I can start messing with provided code samples.
still need to see what hardware is needed for transfer, maybe just 232 chip...
 
here is reply from Atmel support:


Here are few tools you will need for the AT89C2051 project.

- You will need a C-compiler/assembler to generate the .hex file at: www.keil.com or www.iar.com
- The AT89C2051 device does not have the ISP capability, so you will need a parallel programmer for .hex code programming.
You can buy one at: www.hilosystems.com.tw/ or www.elnec.com


You may consider the AT89LP2052 device which has pins and functions compatible with
AT89C2051 device. It also has the ISP capability that is allowed the on-board programming.
In addition, you can use a free "AT89LP Studio" to compile and simulate the source code
and AT89LP ISP Studio for programming.
Refer to this link: http://www.atmel.com/dyn/products/p...&family_id=604&subfamily_id=1679&part_id=3627
There are couple low-cost USB programmers which can be purchased at:
www.mikroe.com (Easy8051A/B board or USB 8051prog2 cable).
www.asix-tools.com (Presto).
 
actually, just got email from company that made the product. although reply was incomplete, at least it was step in the right direction.
I am posting this for any desperate souls out there who might be looking for some clue on how to get this unit to respond (also should apply to similar products like ET-DSP6 and ET-DSP8).

first of all there is some basic code in it already and at least confirmed that RS232 port works. Port settings are 9600, 8-N-1.
also, as is, there is no reply from the unit on RS232, digital I/O etc are not programmed either (this was meant as 'open platform') for RS422/485 option to work nodes need to be addressable.

the only way to see any response from unit is to connect it properly, set correct baud rate and send valid command.
commands are (exactly) 15 characters followed by CRLF such as:
'*01:06123456789' <CRLF> (this displays '1234' on 4-digit display, excess characters are not displayed but must be sent)
'*' is header
'01' is node address (unless program is changed by user, it is always '01')
':06' is actual command (the only command in this case)
'12346579' is data where valid characters are '0'-'9', 'A'-'F','.'
other characters are not displayed but can be used as space holder (didn't work with all characters, but 'g' for example was fine).

proper wiring (only for 4-pin connector marked RS232):
the connector pins are not marked, but the pin1 has square solder pad.
when MAX/OPTO jumper is in OPTO position:
- connect Tx from PC serial port to pin1
- connect GND from PC serial port to pin2.

when MAX/OPTO jumper is in MAX position:
- connect Rx from PC serial port to pin3
- connect Tx from PC serial port to pin2
- connect GND from PC serial port to pin4.

I will have to get to this and modify code (time permitting, now this is on back burner). The most needed change for RS485 support is node addressing. I would like to use available IO for this. For out of box product this means inserting divers 75176 and serial eprom. Eprom must contain ID value.
When unit is powered from 12V, consumption was 2-50mA (2mA when display is off and 50mA when every segment and every dot was on).

4 digital I/O are on DB9 connector so up to 16 nodes can be selected using just plugs with hardwired binary address.
I'll probably also swap the MCU for LS version so programming using low voltage is possible.

@Norlin:

Thank you for reply. I like the Keil's products but they won't fit my budget. I'll either use the Atmel's software or SDCC.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top