Cannot ISP to my board

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

I've been pulling my hair out on this one because I can't seem to pinpoint the problem. I have an STK500 connected to the ISP header of some board that I made. However, I cannot seem to establish and ISP connection to the avr. I am using an atmega64 in a TQFP package with just the bare minimum soldered to the board to get it working (hold reset high with 47k, and a couple 100nf bypass caps). That's all I should need to communicate I would think. I have tried two board (one of which was fully populated) and neither worked. I know my stk500 works because I can connect to another project of mine without any issues. Do you guys have some insight as to what the issue may be? I have assumed that pin 1 is the smaller dot in the upper right of the picture.

I also probed to make sure gnd and +5v was present on the required pins of the uC and all seems well.

Chris

Attachment(s): 

Chief Tinkerer

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

I find that whenever this happens to me, using TQFP packages, I haven't soldered properly. I ended up buying a stereo microscope off ebay - that sure shows the problems you can't see with reading glasses. Plus it's fun for the whole family!

When I bring up a TQFP board I solder the entire chip (never thought to do just a few pins), the bypass caps, and the ISP connector. I don't do the reset resistor or cap. My STK500 can always talk to a board in this condition if I don't have a soldering problem.

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

Search the datasheet for "Serial Programming Pin Mapping".

If you have a transceiver on USART0 you will need a series resistor on RXD.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Are you sure you're connected to the right ISP pins? mega64 doesn't use the SPI pins except for SCK.

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

I double checked that the ISP pins are connected..PB1, PB2, and PB3 (SCK, MOSI, MISO). I don't quite understand what theusch is getting at with the SPI pin mapping when doing ISP programming. I am going to double check soldering to see if that is the problem.

Chief Tinkerer

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

The datasheet says the ISP pins are PE0, PE1 and PB1 (PDI, PDO, SCK).

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

kk6gm wrote:
The datasheet says the ISP pins are PE0, PE1 and PB1 (PDI, PDO, SCK).

I don't get that because page 2 clearly shows them as PB1 PB2 and PB3. Why would they have such a discrepancy? I designed the board based off this pinout diagram :( Guess I learned my lesson.

Chief Tinkerer

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

triden wrote:
kk6gm wrote:
The datasheet says the ISP pins are PE0, PE1 and PB1 (PDI, PDO, SCK).

I don't get that because page 2 clearly shows them as PB1 PB2 and PB3. Why would they have such a discrepancy? I designed the board based off this pinout diagram :( Guess I learned my lesson.


The ISP pins don't always map to the SPI pins. That's why you need to look in the datasheet for "Serial Programming Pin Mapping" as theusch pointed out.

From the datasheet:
"Even though the SPI Programming interface re-uses the SPI I/O module, there is one important
difference: The MOSI/MISO pins that are mapped to PB2 and PB3 in the SPI I/O module are not
used in the Programming interface. Instead, PE0 and PE1 are used for data in SPI Programming
mode as shown in Table 127."

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

Chris,

How many boards do you have?

If you could hack up one PCB for the correct ISP connections you could PERHAPS hold the chips on the PCB while you downloaded the finished code to them, then install them on their own board.

If holding the micro on the PCB, without soldering it, worked, you could also download a Bootloader to the micros, so that you could update them once you installed them on their own PCBs.

Of course the best option is PCV, Ver. #2.

Don't sweat it, however.

There are two categories of embedded designers in the world:

Those who have already screwed up a design & PCB fabrication, and

Those who haven't yet, but will.

JC

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

triden wrote:
kk6gm wrote:
The datasheet says the ISP pins are PE0, PE1 and PB1 (PDI, PDO, SCK).

I don't get that because page 2 clearly shows them as PB1 PB2 and PB3.

There is no discrepancy, page 2 does not indicate what pins are actually used for programming. You made the false assumption that it is MOSI, MISO, & SCK like most other AVR's. The Mega64, like its other 64 pin brethren that are pin-compatible with the mega103, use PDI, PDO and SCK.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

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

Don't feel bad --- you are not the first to make this mistake. Atmel should make a BIG note that this is the case. Same happens on the AT90CAN chips :-(

Dr. David Harris OpenLCB Development Team openlcb.org

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

Quote:

I don't quite understand what theusch is getting at with the SPI pin mapping when doing ISP programming.

???
Quote:

Search the datasheet for "Serial Programming Pin Mapping".

What part of that was unclear?

Quote:

I don't get that because page 2 clearly shows them as PB1 PB2 and PB3.

No, that page indicates the signal names you mentioned, which are SPI signal names.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Got it guys, thanks. Don't knock my ignorance as I am new to this. I'm only in third year EE, so all this stuff is stuff I've been learning on my own. I didn't realize that ISP could use PDI, PDO, as I assumed they had to be MOSI and MISO.

For now I put two jumper wires on the board and I will make a few more when the Chinese new year is over.

Chris

Chief Tinkerer

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

triden wrote:
Got it guys, thanks. Don't knock my ignorance as I am new to this. I'm only in third year EE, so all this stuff is stuff I've been learning on my own. I didn't realize that ISP could use PDI, PDO, as I assumed they had to be MOSI and MISO.

For now I put two jumper wires on the board and I will make a few more when the Chinese new year is over.

Chris


I think the only people who don't get caught by this at some point are those who read about others being caught by it. :)

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

Quote:

I think the only people who don't get caught by this at some point are those who read about others being caught by it.

Or those who actually READ the datasheet before laying out copper? ;-)

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

Quote:

For now I put two jumper wires on the board

Quote:

If you have a transceiver on USART0 you will need a series resistor on RXD.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.