AS4 , STK-500 and ATMega328

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Problems getting the STK-500 to 'see' a ATMega328P.
Using AS 4.18 with the STK-500.
(Note: the STK-500 works ok when connected to a ATMega32 on a prototype board. ISP mode.):(

I setup the jumpers per the Atmel Documentation for the Mega328 HV programming.
The ISP6PIN routed to the SPROG2 (green)
The BDSEL pin routed to PC2
ATMega328 mounted in the green socket SCKT3200A2
PJUMP both installed as shown in manual, same orientation as the BSEL2 (horizontal)
In selecting PP/HVSP mode , does not read the correct signature ( 0xFF 0xFF 0xFF).
In FUSE settings , setting SPIEN gives an error.
Also, cannot change any of the SUT_CKSEL with out error. In the HW Settings it seems the default clock is 3.686 MHZ, so I am thinking I should set the SUT_CKSEL to something like one of the Ext. Osc. 3 "“ 8 MHZ selections.
I tried several CLK configurations including Internal 8 MHZ and the CLKDIV8.
Also, just to test, I removed the PJUMP and BDSEL jumpers and attempted to set the ISP mode. As expected , it also did not work , errors.

Of course, the goal is to setup the M328 so it can be programed using the ISP mode. I think I have the STK-500 jumpers and options correct (?).
Also, I have the PROG CNTRL "“ PORTD and PROG DATA "“ PORTB.

So, I don't know what else to do. I just received the Mega's today from Jameco. I usually purchase Atmel devices from Digi-key or the Micro Controller Store. I have never had this much trouble prior. I am wondering if I could have defective or fake parts, never had that problem before so the last thing I would really consider.

I know I must be doing something wrong but so far unable to figure it out. Hoping someone can see what is messed up and give me corrections.

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why did you post in the AS5/6 forum? Do you think it doesn't have enough bugs? :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My advice is to download the PDF version of the STK500 manual. Then print it on real paper.

With a pencil, modernise the wiring tables. e.g. add mega328P to the box that includes the mega168.

Seriously, humans work better when they study instructions on paper. Somehow my eyes miss things when reading from a computer screen. Most importantly, you can't 'tick-off' each step as you go. (ok, I suppose you could use a felt-tip pin on your screen)

Yes, I have tried HVPP with a mega168 on a STK500. It all works fine if you follow the wiring instructions.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js:

Quote:
Why did you post in the AS5/6 forum? Do you think it doesn't have enough bugs?

John, I did post in the AS4 forum. I don't use AS5/6, at least at this time.

david.prentice: Thanks for the lecture, but I did not detect a real answer to my post.Yes, I have a hard copy of the manual and I referred to that, see the content of my original post:

Quote:
I setup the jumpers per the Atmel Documentation for the Mega328 HV programming

What I was hoping for was that someone might detect something I had done that was incorrect.
The existing manual (paper) is a little outdated and the AS4 help files seem to be a little better. I spent several hours going from the AS4 help file(s) as well as referring to the hard-copy manual. But, so far no progress.
Anyone else have any ideas?

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Yes, I have tried HVPP with a mega168 on a STK500. It all works fine if you follow the wiring instructions.

If you think that a mega328P would behave differently, I will take a mega328P and put it in my STK500.

Seriously, I was trying to give practical advice. Only you can tick off your own checklist. Even so, it is still easy to put a jumper on the wrong pins. A photo of your STK500 would let many fresh eyes have a look.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David, thanks for the follow up. I think I went through the jumpers and wiring instructions.
I will get a photo of the board very soon today.

As a note, I went back to the STK-500 again, installed just the
jumpers and the ISP6PIN, no PROG CNTRL or PROG DATA , the
10 pin cables that connect to PortD and PortB.

Interestingly enough, the ISP mode can read the proper signature (0x1E, 0X95, 0X0F) of the chip and seems to display the correct Fuse settings as well.

Before I go any further and try to change any fuse settings, I will load a simple test program just to verify that every thing is working as expected.

I do have several clarifications on the manual & help file dealing with jumper settings:
[1]PJUMP- Atmel doc's indicate that these need to be installed
for HV programming and mentions that they need to be removed for ISP(?). With the ISP mode working as I mentioned above, these jumpers are installed.

[2] Routing the BDSEL pin1 to PC2(?) In the present setting(s)
I just have the jumper installed(?).

I have to sign off for now and will check later and post any
progress and changes I made.

I can now eliminate the ATmega328P as the problem as well as the STK-500.
Thanks.

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I did post in the AS4 forum.
I moved the thread here from AS5/6. :wink:
Quote:
I setup the jumpers per the Atmel Documentation for the Mega328 HV programming.
Why do you need High Voltage programming?
Quote:
The ISP6PIN routed to the SPROG2 (green)
This is not required for HV programming.

Maybe you should start fresh. Rewire the STK500 for normal ISP and try it out again.

MAKE SURE that the ISP frequency is set to say 125KHz or close to that for ISP. AT times the STK500 goes nuts and tyhe frequency gets set to very low frequencies.

EDIT you got there before I posted. :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js:

Quote:
Why do you need High Voltage programming?

I need to change the clock source.
I can't get the STK-500 to reliably connect to the device.
I have tried several settings including carefully making the jumpers per the doc's. Even when I could get the correct signature of the device I still could not make any fuse settings changes. Now, I have been through so many changes , jumpers/settings, I have lost confidence that I even know what the hell I am doing. :oops:

I have been able to read the signature while setting up for
HV programming and then not able to make
any fuse changes. :?:

So, if you are someone can get me straight on how to set up (jumpers/settings) to work ISP mode that is what I am looking for. I will keep playing around with this and then soon just put off using the ATmega328 at all. :twisted:

I have searched the Internet and most of what I find are references to the Arduino boards. I do have a Aruino (UNO) board and it is just fine, but reluctant to use the Mega328 to test the STK-500. I am really just interested in using the M328 in a non Arduino environment.

But, thanks anyhow. :?

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe you can start with a shot of the STK500 setup? As I said before just try ISP it should work unless the fuses have been messed up badly. Just reset all jumpers to the original state.

Can you read the target voltage from Studio with the STK500?
Have you checked the ISP frequency as I mentioned above?

The reason I'm repeating this is that at times these setting have a habit of self destruction.

Maybe a couple of screen shot of Studio could give us a clue about wht's going on.

And to give you hope I programmed a Mega328 2 days ago with the STK500.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you can read fuses and lockbits with HVPP, you should be able to erase the device and write new values.

I possess a couple of ATmega328P DIP-28 devices on Arduino boards. I would be quite happy to put one of these in a real STK500.

If your STK500 has had a hard and productive life, it is always possible that the jumpers are a little tired and worn. So I would use fresh jumper wires and links, or at least swap them around a bit.

There is NO point in connecting anything differently to the STK500 manual. Especially when you have 12V lurking with HVPP.

David.