Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Programmer for an Atmel 8051
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Programmer for an Atmel 8051

by WickedShell on Sun May 09, 2010 3:00 pm

I already have an Atmel AT89C51RB2, which is an Intel 8051 core with a couple of speed ups, and extra on-board memory, that I'm looking to program, but lack a programmer, for it and am shaky on how to remedy this. The chip can be programmed via an ISP bootloader solution which seems to be through UART, or via a parallel EPROM programmer.

My computer lacks a serial port, and I have had some bad experiences with USB to serial converters, so I'm looking for other solutions to program this. Commercial solutions all seem to be very expensive, and it seems to me that programming via the ISP boot loader would be more convenient. To this end I need to find a way to interface via UART. The solutions I have so far I believe to be overkill, but here they are.

1. Get an arduino and program it to bit bang the hex files onto the 8051, this would be overkill as I'd be using a decently powerful device to program another one.
2. Get a bus-pirate, which if I'm reading correctly will provide me with a uart connection to my computer without much work, and program through that.

Both solutions cost the about the same (~30) but provide different other uses, the arduino a rapid prototyping platform, but the goal of this will be to work on the 8051, so this seems silly, but the use will be there. The bus pirate however will provide a easy to use ability to communicate over many other standard protocols that I will have need for later.

Given these considerations I'm leaning towards the bus pirate, but I'm wondering if anyone has any advice either way or alternate solutions before I make a decision. Or any terrible things I've overlooked.
WickedShell
 
Posts: 5
Joined: Sun May 09, 2010 2:36 pm

Re: Programmer for an Atmel 8051

by brunnenguk on Sun May 09, 2010 3:29 pm

Unfortunately a lot of programmers need a serial port. Part of the reason I dumped the serial port based programmer I used in favour of a USB based PICKit2 (that and it was useless).

Are you using a desktop or a laptop? If you have a desktop then there are 2 options I can think to get a serial port: 1) Do you have a serial header on your mainboard? If so there is an option 2) do you have space for a serial card?

Unfortunately I can't think of anything to help in laptopland other than a PCMCIA/ExpressCard to serial device.

By the way, I did a search for the bus pirate and found an article on hack a day. It looks like you need a serial port for that (saw the operation overview picture). Something you might want to bear in mind (unless as usual I'm looking at it wrong)

Best of luck, hope you find something that works
brunnenguk
 
Posts: 9
Joined: Fri Nov 28, 2008 12:00 pm

Re: Programmer for an Atmel 8051

by franklin97355 on Sun May 09, 2010 3:49 pm

If you have no serial and no parallel and don't want to use USB your only choice is an add in card to provide a connection. Personally I'd go with USB (both the Arduino and Bus Pirate are USB)

franklin97355
 
Posts: 21561
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Programmer for an Atmel 8051

by WickedShell on Sun May 09, 2010 4:07 pm

I'm on a laptop, so no serial or parallel. I'm quite happy to use USB, (in fact I hope I end up with a USB solution)

Yeah, HaD seems to have a love affair with Bus Pirate, there's about 3 articles directly revolving around bus pirate, and a bunch of others where using bus pirate is an integral part of the project.

Any reason to go bus pirate xor arduino?
WickedShell
 
Posts: 5
Joined: Sun May 09, 2010 2:36 pm

Re: Programmer for an Atmel 8051

by JohnDowdell on Mon May 10, 2010 7:41 pm

WickedShell,

in the following video i demonstrate accessing a microcontroller in the same family as the AT89C51RB2 using an FTDI based usb-to-serial converter.
http://www.youtube.com/watch?v=oDdDgYZSC9Q

To be fair, even if you did this through a Bus Pirate or an Arduino, i think most Arduino's use an FTDI usb-to-serial converter IC on board and the Bus Pirate uses an FTDI usb-to-serial converter on board as well.

I've yet to encounter an issues with FTDI converters and they seem to cover serial hardware handshaking well enough if you need that for something.

Also i should point out that on the board i use, it has a RS232 to ttl level shifter on board. If you didnt want the hassle of RS232 serial levels, i believe there is a usb to ttl serial converter in the adafruit shop.

JD
JohnDowdell
 
Posts: 27
Joined: Sun May 02, 2010 1:59 am

Re: Programmer for an Atmel 8051

by WickedShell on Mon May 10, 2010 8:21 pm

John, you are a most awesome person. :D

I'm only sorta of looking for a reason to get an arduino or bus pirate. Minimal interest in the arduino, but the bus pirate seems useful, that being said less work is in many ways better. :)

Couple of quick questions;
-From looking at the converter on adafruit that you pointed out, it converts +-12 volts, I would need to add a MAX232 or equivalent to get to TTL for programming, correct? (And probably on many outside of the one on adafruit)
-I have flip, but haven't actually used it "real world" yet, and I would like to leave Flip in control of the actual ISP programming, and to that end if went towards the bus pirate do you (or anyone) know if it will let me configure the bus pirate as a pipe for flip, or would I need to write an interface for the bus pirate? (Still looking at it as a tool, with bonus features).

I actually have a USB to RS232 converter (+-12 volts) but while it powers up I can't seem to functionally use it under windows (bah) or Linux.

Side note: he is correct, you had a 50/50 chance :P (or close enough in any event that we can take it to be 50/50), and I don't actually have a board I only have the chip. Kinda silly, but I couldn't find any cheap 8051 boarders when I got this. Although one of the first links I clicked on when I looked up the 89C51ED2 was a $24 board, with MAX232 on board for isp programming... Oh well.

So it sounds like, casue I'd forgotten that I do actually want flip to do all of the handshaking and error catching, the best route would be to get a solid/reliable USB to RS232 converter... Darn your good! :)
WickedShell
 
Posts: 5
Joined: Sun May 09, 2010 2:36 pm

Re: Programmer for an Atmel 8051

by charliex on Mon May 10, 2010 11:29 pm

WickedShell wrote:IHaD seems to have a love affair with Bus Pirate, there's about 3 articles directly revolving around bus pirate, and a bunch of others where using bus pirate is an integral part of the project.


Ian lesnet is involved in HaD, http://hackaday.com/author/ianlesnet/ thats probably why, not thats a bad thing or board.
http://032.la - Null Space Labs.
charliex
 
Posts: 179
Joined: Sat Nov 28, 2009 5:54 pm
Location: Las Vegas

Re: Programmer for an Atmel 8051

by chatham on Thu May 13, 2010 3:23 pm

Looking at the datasheet, it looks like this is a chip that is programmable via a standard ISP programmer. Depending on your setup and toolchain, you might just want to look into the dedicated ISP programmers. I've got a ($35) AVR-ISPmkII, which I'm in love with - it's fast, hassle free, and integrates perfectly into AVR Studio on Windows (which makes fuse programming super easy/hard to screw up and semi-brick your chip). My brother has the Adafruit USBtinyISP programmer and is using AVRDUDE for programming, since it's a little bit of work to get it to work with AVR Studio. He likes it, although it's a bit slower, it's also $10 cheaper.

Anyhow, they're both USB. I've only got a laptop, and my AVRISP has worked great. I'm going to be upgrading to the $60 AVR Dragon here pretty soon, since that also supports on-chip debugging for a lot of chips, so if you're looking for something a little more advanced (but still USB), you might look into that too.

Of course, the ISP programmers are dedicated devices, but at the same time, if you save yourself 2 or 3 hours of set-up time for Bus Pirate or ISP-over-Arduino, that loss of frustration in my book would make it well worth it. There are enough really annoying things to deal with in embedded programming without having to figure out why your programmer isn't working!
OpenChord.org - Open Source kits to let you play Guitar Hero with a real guitar, or build your own Wii/PS3/USB controllers.

chatham
 
Posts: 144
Joined: Thu Feb 04, 2010 2:30 am

Re: Programmer for an Atmel 8051

by WickedShell on Fri May 14, 2010 12:33 am

Alan Chatham wrote:Looking at the datasheet, it looks like this is a chip that is programmable via a standard ISP programmer.


I actually can not find a cheap programmer, for this anywhere, in part due to the fact that this isn't an AVR, and that the AT89C51RB2 (my chip) isn't complelty compatablile with any of the other Atmel AT89C51 or AT89C51S* isp programmers. And I have been unable to deduce the difference between the two.

John I pulled out and am attempting to coax my usb to serial converter to behave correctly. :D
WickedShell
 
Posts: 5
Joined: Sun May 09, 2010 2:36 pm

Re: Programmer for an Atmel 8051

by WickedShell on Fri May 14, 2010 2:36 pm

Alright, I've restored my USB-Serial coverter to working function, but have run up against a problem with 64 bit linux and flip. Some of the libraries that are linked are only 32 bit libraries, and I can't run them on my 64 bit system. (Nor is switching from 64bit to 32 bit an option as I regularly use programs that require the larger address space). Any ideas as for how to go about this?
WickedShell
 
Posts: 5
Joined: Sun May 09, 2010 2:36 pm

Please be positive and constructive with your questions and comments.