Listing Program At89s51 Compiler

27.09.2019by admin
  1. C++ Program Compiler

Hi i try to slove the soc7 problem, i found the offset value, but where the compile listing program located i dont know, let me know where it locted.

Device Programmers. Advantech Equipment Company. Ceibo. Ceibo. Dataman Programmers Ltd. Dataman Programmers Ltd. Dataman Programmers Ltd.

  • Calculation tool for setting Timers, UART, parameters in 80C51 Microcontrollers - This Excel file allows a user to determine register values for PCA, UART and Timers in order to obtain a specific signal (period and duty cycle) according to the application`s oscillator frequency and internal clock mode (X1 or X2).
  • Programer for 8051(AT89S52) using parallel port This article shows how to program 8051 using parallel port of computer. I used AT89S52 chip. Which have 8052 core.So let’s see what is more in 8052. I have used keil micro vision compiler for my all programming. You can either visit my blog or just check my scribd account you will.

Dataman Programmers Ltd. Dataman Programmers Ltd.

Dataman Programmers Ltd. Dataman Programmers Ltd. Dataman Programmers Ltd. Dataman Programmers Ltd. Electronic Engineering Tools Inc. Electronic Engineering Tools Inc. Electronic Engineering Tools Inc.

Electronic Engineering Tools Inc. Electronic Engineering Tools Inc. ELNEC. ELNEC.

ELNEC. ELNEC. Equinox Techologies. Equinox Techologies. HI-LO Systems Research Co., Ltd. HI-LO Systems Research Co., Ltd.

HI-LO Systems Research Co., Ltd. HI-LO Systems Research Co., Ltd. HI-LO Systems Research Co., Ltd. HI-LO Systems Research Co., Ltd. HI-LO Systems Research Co., Ltd.

Minato Electronics, Inc. Phyton. System General. XELTEK. XELTEK. XELTEK.

XELTEK. XELTEK. XELTEK.

I am really sorry to bring this up in your AVR forum, but as I've seen, some of you have experience with the 8051 microcontrollers. I've been reading some posts here, about programming the AT89S52 with STK500 and AVRISP in AVR Studio. But what I have yet to find out is if you are compiling the source code from within AVR Studio with AVR GCC? My first thought would be hell no, you can't. But no one specifies what compiler they've actually used.

I'm trying to gather enough information to complete a AT89S52 programming environment. This is how far I've gotten: - Can be programmed with both my STK500 and by AVRISP (you think my AVRISP v2 programmer from Pololu will work?

) - Can be programmed from AVR Studio What I have yet to find out - Must I invert the reset signal by hardware? - Can I compile code with AVR GCC? For those who have a complete programming environment for Atmel 8051 series (specifically AT89S52), using mostly AVR based tools, I would be very happy to hear from you. Westfw wrote: gcc does not support the 8051 architecture at all, so no avr-gcc, nor any other gcc. I assume most people are using an assembler. There is also 'SDCC' the Small Device C Compiler. I think I've heard that it works reasonably well for 8051.

And of course various vendor-provided compilers (Keil and IAR being two of the well-know vendors.) (Atmel has a VS-based development environment for at least some of their 8051 products, including a binary of SDCC) I know MikroElektronika has an IDE specificly for Atmel 8051 also! I will check that Atmel alternative you're mentioning. I was hoping to use AVR Studio, so switching between AVRs and 8051 would be less of a hassle. If I can find a compiler I like, that works, I can just type in it's executable file somewhere in AS, right? Btw, VS = visual basic?

David.prentice wrote: None of the AVR tools support 8051 assembly or compilation. Some programmer hardware supports it. STK500, AVRISP-2 via stk500.exe or Studio The Atmel STK500 only uses active-high RESET) PonyProg will let you configure the polarity of the RESET line. SDCC works fairly well as an 8051 C compiler. Keil is excellent, but do you want to pay $1000 for an obsolescent CPU family? The AT89S52 is a pretty bog-standard 8051. There are faster, better featured alternatives.

No, I don't want to spend $1000 on this, since the reason I want to get this going is because I bought a but-load of AT89S52 for a buck a piece, without thinking first:) STK500 is only active-high RESET you say, like the atmel 8051's. So why is STK500 working with both?

I tried putting one AT89S52 in its socket, according to the manual, but could not read its signature or load it with a hex file (both failed entering programming mode, using the programmer that opens from within AS4). I'll get back after some research! You put the AT89S52 in the SCKT3000D3. Select AT89S52 in Programmer Dialog Read Signature etc.

Note that you need the STK500 clock or a crystal. You cannot use AS4 or AS5 for an IDE. If you like IDEs, you can use Keil uVision4. Although there is a code size limit for Keil, the AT89S52 is pretty small.

Use as many library functions as you can, and you can get 6k of code. SDCC is just a command line set of tools.

If you enjoy configuring Eclipse, NetBeans or whatever you can probably 'integrate' it. I would avoid all MikroElektronika software like the plague. Their hardware is very good.

David.prentice wrote: You put the AT89S52 in the SCKT3000D3. Select AT89S52 in Programmer Dialog Read Signature etc. Note that you need the STK500 clock or a crystal. You cannot use AS4 or AS5 for an IDE. If you like IDEs, you can use Keil uVision4. Although there is a code size limit for Keil, the AT89S52 is pretty small. Use as many library functions as you can, and you can get 6k of code.

SDCC is just a command line set of tools. If you enjoy configuring Eclipse, NetBeans or whatever you can probably 'integrate' it. I would avoid all MikroElektronika software like the plague. Their hardware is very good. I appreciate your comments very much. I'd be very happy if you'd answer these questions (I know it looks rude to list them and direct them at you, but they would otherwise just be scattered through the text.) - In AVR Studio I can type in the path to my own compiler. Why can I not write my code in AVR Studio 4, and use this compiler that I specified?

- You say that RESET polarity is fixed on STK500. Since AVRs and 8051s have reversed RESET polarity, how can this work at all? Let me add, I am giving this a try while asking here, as soon as I pop an AVR in it's socket it will program just fine. The AT89S52 still won't work (no signature reading, no fuse bit reading, no programming). While Atmega8 is inserted, and device is specified as AT89S52, I can not read Atmega8 signature (ISP entering programming mode failed). If I simply change device to Atmega8 it works.

I can usually read signatures from other devices independently of which device is inserted, so I think this may have something to do with the RESET polarity actually being reversed when selecting the AT89S52 device. If you can configure Studio for SDCC, good on you. You can only have one chip in the STK500 at any one time. Note that the D3 socket is the right-hand one.

You must provide a clock. Set the STK500 clock to 3.68MHz and your ISP frequency to 115kHz.

It does work. I have done it. The stk500.dll (used by Studio or stk500.exe) sets the reset polarity as required for AVR or AT89S. You can use the AT89S on an external board exactly like you do with an AVR.

I am quite happy with numbered questions. It makes it a lot easier to answer. I wish that more people used numbers. Quote: I want to get this going is because I bought a but-load of AT89S52 for a buck a piece, without thinking first Shame on you for not thinking!!;) This 'but-load' you mention.Just how big is this piece of ass you bought? Any chance you could return it to the pimp? Kidding aside.Just how many did you buy? The reason I ask is that for all the trouble you are going through is it worth it?

I have old development gear for the 8051 stuff with the '52 thrown in, but it is for the most part useless as already noted. I pitched about 2500 '31//51/52's a while ago when I saw the light and stayed with the avr's because the tools are essentially free, the support(this shangri-la) is awesome, and the price is pretty fair. The old saying of learning from your mistakes can also mean paying for them as I have learned the hard way. Chalk this up to experience and forget about the units Jim. Quote: - In AVR Studio I can type in the path to my own compiler.

Why can I not write my code in AVR Studio 4, and use this compiler that I specified? Because under Project-Configuration all those options you are picking lead to the formation of a GCC command line. It is VERY unlikely that a non-GCC compiler will understand those options thought I guess some things (like -E and -D are common to a lot of different compilers). Anyway, bottom line is, you can't. If you are looking for a configurable ISE than can be adapted to a lot of different processors/compilers but maintains a common 'look and feel' then explore Eclipse or NetBeans or Code::Blocks.

If you cannot find a command line tool for AT89 programming that can be launched by one of those IDEs then feel free to stick to AS4 as the IDE purely for programming (which is the only thing you CAN use AS4 for when using AT89). Your main IDE will be creating.hex files, AS4 knows how to program these into the chip. David.prentice wrote: If you can configure Studio for SDCC, good on you. You can only have one chip in the STK500 at any one time. Note that the D3 socket is the right-hand one.

You must provide a clock. Set the STK500 clock to 3.68MHz and your ISP frequency to 115kHz. It does work. I have done it. The stk500.dll (used by Studio or stk500.exe) sets the reset polarity as required for AVR or AT89S. You can use the AT89S on an external board exactly like you do with an AVR.

I am quite happy with numbered questions. It makes it a lot easier to answer.

C++ Program Compiler

I wish that more people used numbers. Let's do lists.

I'm using the correct socket. Only one chip inserted at once. ISP cable is inserted at SPROG3 (red) - Clock settings and ISP frequencies matches your recommendations. OSCSEL jumper is fitted according to the manual for on-board crystal. XTAL1 jumper is fitted. I've tried three AT89S52 so far.

I'm no professional, but I've have been programming AVRs for a while with a couple different programmers and many chips. I've been through most difficulties before, but I'm really stuck on this one. As soon as I pull out the AT89S52, put an Atmega8 in (also moving ISP cable and changing device name in AVR studio) the signature reads out just fine instantly. All settings are the same as in the list above. Any last hints on this? Quote: I want to get this going is because I bought a but-load of AT89S52 for a buck a piece, without thinking first Shame on you for not thinking!!;) This 'but-load' you mention.Just how big is this piece of ass you bought? Any chance you could return it to the pimp?

Kidding aside.Just how many did you buy? The reason I ask is that for all the trouble you are going through is it worth it? I have old development gear for the 8051 stuff with the '52 thrown in, but it is for the most part useless as already noted. I pitched about 2500 '31//51/52's a while ago when I saw the light and stayed with the avr's because the tools are essentially free, the support(this shangri-la) is awesome, and the price is pretty fair. The old saying of learning from your mistakes can also mean paying for them as I have learned the hard way.

Chalk this up to experience and forget about the units Jim Hi Jim, I would have to agree with you completely. Some times, after doing things without thinking, we end up, unintentionally, digging ourselves into a deeper hole trying to dig ourselves out. The way I see it, with either money (in buying additional hardware) or peace of mind (modifying his existing hardware), he's going to pay. I hate not to contribute anything to the discussion, but hey, lots of times it takes others to put things into perspective. Hey, I only bought 20 of these at $1 per piece, it's no big loss!

I don't usually buy in quantities at all, so having 20 of these laying around doing nothing is bugging me. I think it was this site. It's not the end of the world if I don't get this going. I am using an LCD which requires many digital pins, and I'm out of mega32's. It's a handheld gaming device, and so I really only need the digital pins for LCD, display and LEDs, no other peripherals.

So I found these still in the padded envelope they came in. Quote: - In AVR Studio I can type in the path to my own compiler. Why can I not write my code in AVR Studio 4, and use this compiler that I specified? Because under Project-Configuration all those options you are picking lead to the formation of a GCC command line. It is VERY unlikely that a non-GCC compiler will understand those options thought I guess some things (like -E and -D are common to a lot of different compilers). Anyway, bottom line is, you can't.

You can just type in your own command line invocations under custom options. I don't like eclipse for embedded, I've tried some AVR plugins, and also the texas instruments environment for MSP430. I like the simplicity of AS4. Ok, stupid remark probably, but why should the OP not be able to use studio 4 for both IDE and programming. If he has his own tool chain for the 8052( so not winavr) then he should be able to complie and link and thus make a hex file using an external make file. If the studio is capable of programming the device then he should be able to use the standard dialog, set-up the right programmer(stk500) and select the hex file that is made by his own make file and thus as such use the studio for it all. The only disadvantage I see is that he has to use his own external make file in this case (and as I still do not really grasp how these work I my self do not like that idea thus find it a draw back).

Westfw wrote: Is it possible that your 89S52s are fused such that ISP no longer works There is no such fuse in the 'S52. There's little reason why the ISP programming through STK500 wouldn't work from AS4 and/or the command-line stk500.exe. I used it already, not in the STK500's socket, but in the target hardware through the standard cable. When I get home I can try it directly in the STK500. Even if possible to do what meslomp suggests above, I see no reason why would you stick to AS4 (and especially its atrocious editor), except for device programming (and even that could be done better with the command line tool).

Any would do - I know none which would not support relatively comfortable running of command-line tools. Quote: stupid remark probably, but why should the OP not be able to use studio 4 for both IDE and programming. If you define IDE as 'any program that can launch make.exe' then I guess AS4 would qualify as an 'IDE' for an alien compiler with 'use external makefile' ticked. If, on the other hand, you consider an IDE something where you can make menu selections and so on for things like device type, device frequency, optimisation level then on clicking 'Build' the IDE takes all that info, builds a dynamically created Makefile and then invokes make to process that file then it's not going to work with a foreign compiler is it? That foreign compiler is not going to understand all the GCC-esque stuff the IDE just created in the Makefile written for the avr-gcc compiler. You cannot even use AS4 as an IDE for AVR32 which even has a variant of GCC let alone anything more 'foreign'! Equally you cannot use AS4 for debugging non-Atmel AVR8 parts as it does not contain a disassembler for those foreign processors either.

So you are left with a (unthinkably crap!) text editor and a programming dialog. Does that really count as an INTEGRATED development environment? If you want a common IDE for all your work you need one that has bolt in compilers, bolt in programmers and bolt in debuggers (and a decent editor!). As already noted Eclipse, Netbeans, Code::Blocks are just three of several that attempt to deliver this goal for a 'common look and feel' IDE for various processors and compilers.

David.prentice wrote: Does anyone 'integrate' SDCC? Oh yes, of course. This one called appears to be a dedicated one, and Eclipse is mentioned on that site. I never tried these. Infineon integrates SDCC into their environment (a rather huge one), AFAIK it's Eclipse-based, too. Played with it briefly. Atmel itself has integrated it into their new.

Played with it (and provided some feedback to Atmel) and plan to play more - probably will report on 8052.com soon. This all is only the '51 stuff; there might be more for the HC08/Z80/PIC and whatnot. Of course, none of them have STK500 support.

HenrikPalm wrote: (shipping from Norway) Waitaminute: you're from Norway and bought the chips from India? Then they may quite well be counterfeit too. JW What, because they saw that I'm from Norway?

I love that site, shipping time from countries like India and Thailand (taydaelectronics.com) are superior to Chinese, that freakin boat takes forever. Considering the only place in Norway that sells electronics sells it for $4.8 I will continue to risk my pocket change on Asian websites:) I see there is a discussion going on about IDEs and compilers.

I completely agree with AS4 not being a complete IDE with only a compiler and ISP programmer. I've read about Code::Blocks. I think it's nice, but I thought it was still some non-working beta last time I've checked. I will ship-a-chip to England now. Who knows, maybe I'll get it back with a 'blinky' program or something (David, I don't need it back).

HenrikPalm wrote: What, because they saw that I'm from Norway? No, because over the years, we've seen quite a couple of complaints on counterfeit parts being sold over there - especially the '51 derivatives, which appear to be popular amongst the hobbyists in India. This is not to say that the mentioned webshop is not a honest and reputable one, just that you should consider that as a possibility too. My comment on you being from Norway was only the surprise; I did not mean to insult you and I apologize if it did sound so. The 'S52 sells for below $2 currently for quantity of 1 and closer to $1 for moderate quantities at most distributors (my local supplier quotes ). I understand that that one particular distributor in Norway may have different prices.

As Norway is member of, you should have little difficulties buying from distributors in EU - or not? I was not insulted, in any way!

Norwegian prices on electronics, that's an insult. I didn't know counterfeits was big in India, I thought that was China mostly. Fascinating business by the way, with a very negative result of course. I've seen pictures of people sitting in the streets with a circuit board in one hand, a propane torch in the other, breathing soldersmoke and various gases all day. Norway is an EEA member, ordering from the EU is no problem other than the 25% VAT that goes on top of the order total (incl. Shipping price) on every order above 200NOK (26 EUR).

While the topic was never about buying in bulk from asian webstores. I buy from places like goodluckbuy.com, suntekstore.com, taydaelectronics.com, futurelec.com and so on all the time, simply because their prices are better, and shipping is many times cheaper than even regional shipping within Norway. Besides, I like the waiting. I order something I think looks nice, then I forget about the order. Suddenly there's a package in my mail-box with this secret 'what was it I ordered again?' HenrikPalm wrote: - OSCSEL jumper is fitted according to the manual for on-board crystal.

I did not notice this until I got to the actual STK500: do you have a crystal fitted, too? Otherwise, you have to switch it to the other position, closing 1-2, and then the 'software oscillator' (clock output from the '8535) drives the programmed 'S52 clock input. JW edit PS. Just tried to set OSCSEL into 2-3, without crystal does not work. Got some random crystal from the drawer (turns out it's 12MHz), fitted into the 'socket', ISP now works and the ISP clock can be cranked up to 460k (has to be xtal/16 - note also that xtal during programming has to be 3MHz). Jan, I had a swift look at 'LPDeveloper Studio'. Mickey Mouse could wipe the floor with it!

I think that I will continue with command line Make. I have never configured an IDE, but surely the Build process is much the same with any Unix-style toolchain. In fact I wrote a regular 'cc' that controlled several 68000 C compilers by parsing a script. Not much different to creating a Makefile on the fly. Keil or MSDOS syntax is a nightmare but not impossible. Have you had a go with a real AT89LP6440 chip yet? Can you really debug it over a serial line?

I have always programmed AT89S52 with a 16MHz or 18.432MHz crystal. So I had never used the STK500 clock. Drivers mpx en5038a winxp. Yes, you can ISP at 1MHz or so. The AT89S8252 is a different beast.

You have to go a lot slower. (and the STK500 can't do that chip anyway). David wrote: The AT89S8252 is a different beast. You have to go a lot slower. (and the STK500 can't do that chip anyway)The 'S8252/'S53 is past for quite a couple of years now (okay what's 5 or so years in the '51 realm?;-) ). IIRC, it was the first ISP-able 'S5x from Atmel - I wonder whether it pre-dated the AVRs or was it the other way round?

The STK500 is very well capable of programming any 'S5x variant, regardless of the variability of their ISP, and even of parallel programming through a simple passive adapter, it's just the question of firmware. The original firmware as it is now fills up the STK500's '8535 to the brim, that's probably the reason why Atmel never went for it (although I was able to patch it to support the 'S8253 without breaking all the other stuff; but I admit it's harder for them as they are using C for the firmware).

Once the 'S52 was in the STK500, I concocted a quick test exercising the STK500's LEDs (PORTB and LEDS connectors need to be connected with the 10-lead ribbon cable). The RESET button needs to be pressed after programming. Enjoy!;-) JW EDIT PS. Execution was unreliable until I relized that the /EA input is floating. Instead of properly pulling it high I rather went to ISP programming again and programmed the lockbits to 'external execution disabled (the highest setting).

That revealed one defficiency of the programming through AVRStudio's STK500 plugin - the lockbits have to be programmed one-by-one, but Studio attempts to program them all at once, so one has to do that manually - select always only the next level of lock, press 'Program' and repeat until the required level is reached. PM me with your address. Then I can post you a good AT89S52. We can compare notes with the real chips in each others STK500. I suggest that you use the Keil evaluation. You like IDEs.

You can create a surprising number of projects within the C User Code limit. It allows you to use as much Library as you like. The ASM is unlimited (I think) It has simulation for a restricted 2kB binary. Once you are comfortable with the 8051, and if you need more User Code, use SDCC. You can use avrdude.exe or stk500.exe from the Keil Tools menu to program your chip. HenrikPalm wrote: - OSCSEL jumper is fitted according to the manual for on-board crystal. I did not notice this until I got to the actual STK500: do you have a crystal fitted, too?

At89s51

JW No, I saw this, but then I forgot! I've tried with both jumper settings, but I don't know if I tried both with the recommended settings I've collected through-out this post. The stk500 manual got me a bit confused. When I looked at the schematic for the oscillator settings I noticed only one pad for crystal, but I didn't figure if it was the socket or another 3.6864 fixed mounted somewhere else on the board (didn't spot one physically though). But now I see that the on-board oscillator setting must be the 3.6864 one because it is programmable. I will have another go at this this weekend.

David; I will try Keil then. It's not that I'm very fond of IDEs, but I want the route from text editor to compiler to programmer as short as possible.

In AVR Studio, I press F7 to build then click the 'program flash' button. I got it working! My setup is on a veroboard: 9.216MHz crystal w/22pF capacitors.

6-pin ISP cable from STK500, VTARGET jumper removed and 5.0 external supply. Reading signature and programming at 460KHz. Just downloaded Keil and looking forward to trying out my setup. Edit: it also worked with my pololu AVRISP programmer.

Currently using the STK500 ISP-mode plugin in AVR Studio 4 and/or Stk500.exe as programming tool in Keil uVision 4 IDE. Edit: Also pulled reset high with 10k resistor and 10uF cap to ground. To make the circuit run I had to put AE pin to Vcc.