View previous topic :: View next topic |
Author |
Message |
Anton
Joined: 19 Apr 2005 Posts: 51 Location: United Kingdom
|
Posted: Sat May 14, 2005 5:42 pm Post subject: Assistance with m128 |
|
|
Hi,
I have been using the Amega m8 processor recently with great results. I have now moved up to the m128 chip.
My m8 is mounted on a pre made board with the crystal and reset circuit + socket for stk200/300 programmer and all works well.
My new m128 chip is mounted on a PCB with the pins breaking out onto 4 x 16 pin IDC headers. No other components are on this board so I must mount the crystal, reset and STK programming socket circuit externally.
I have connected some IDC sockets with Ribbon cable to the m128 board to break out onto some breadboards. I have cut the crystal cables short so that they are 1/2cm from the IDC connector and I have soldered a 16Mhz crystal here with the iron set to a low temp. I have also taken great care that all pins were connected correctly before power up via a 5v regulator.
I have followed the pin connection guidance in the atmega 128 summary from atmel and I also have the schematic for the pre-made m8 board for reference.
The problem is that I can not program the m128 chip, I just get "Could Not Identify Chip with ID: FFFFFF" Error. I have now added the led circuit for the stk 200/300 programmer and I can see a double flash of the LED where it attempts to connect to the proc. I can switch forward and backwards between the m8 and m128 and the m8 always works first time, in fact it has never failed in over 900 writes to the chip. But the m128 always fails and has never worked.
I will order another chip for reference but I just wanted to check with you guys before I hook up the new chip for testing.
Here are the connections that I have made:
VCC is from a 5v regulator.
Pin 21, Pin 52, Pin 64 = VCC
Pin 22, Pin 53, Pin 63 = GND
Pin 23, Pin 24 = 16Mhz Xtal
The SCK, MOSI and MISO pins are set up as per my atmega 8 schematic with the 2x5 IDC header with the 3 ground pins and led circuit.
The only thing I am unsure about is the reset circuit. My atmega 8 board has an arrangement with a 10k resistor and diode, but I understand that this is to trigger a rest below a certain voltage. I do not have this on my 128 set-up. I have currently connected the reset pin to the reset line of the stk200/300. I also have tried a pull up resistor of 10k from reset to VCC. And also tried it tied directly to VCC.
When switching between loading the m8 and m128 I simply change the regfile from $regfile = "m8def.dat" to $regfile = "m128def.dat". The crystal is always set to $crystal = 16000000.
Any Ideas?
Thanks and Regards,
Anton |
|
Back to top |
|
 |
Dibor
Joined: 04 Dec 2004 Posts: 137 Location: ISRAEL

|
Posted: Sun May 15, 2005 12:05 am Post subject: |
|
|
Hi !
What about two capacitors 22p from Xtal ends to ground ? |
|
Back to top |
|
 |
Anton
Joined: 19 Apr 2005 Posts: 51 Location: United Kingdom
|
Posted: Sun May 15, 2005 11:04 pm Post subject: |
|
|
Hello,
Thank you for your response.
Yes I have two caps at the crystal, value 20pF.
How should the reset pin be connected? I have it connected directly to the reset line of the stk 200/300 programmer. Are any additional components required like the 10k pull up resistor?
Regards,
Anton |
|
Back to top |
|
 |
philm
Joined: 14 Jul 2004 Posts: 138 Location: Australia

|
Posted: Mon May 16, 2005 12:53 am Post subject: |
|
|
The M128 does not use the SCK, MOSI and MISO for programming.
From the M128 data sheet.
Quote: | Note that throughout the description about Serial downloading, MOSI and MISO are used to describe the serial data in and serial data out respectively. For ATmega128 these pins are mapped to PDI and PDO. |
Many people have made this mistake. |
|
Back to top |
|
 |
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands

|
Posted: Mon May 16, 2005 7:47 am Post subject: |
|
|
@ Phil,
Thanks, i'am de developing a board with an M128 and have overlooked this pin swap.
So you saved me a lot of time searching for this pin swap.
@ Anton,
Go to the following PDF and read page 303 and 304 there is explained how to program the M128 as simple as possible.
http://www.atmel.com/dyn/resources/prod_documents/doc2467.pdf
Frank. |
|
Back to top |
|
 |
Dibor
Joined: 04 Dec 2004 Posts: 137 Location: ISRAEL

|
|
Back to top |
|
 |
Anton
Joined: 19 Apr 2005 Posts: 51 Location: United Kingdom
|
Posted: Mon May 16, 2005 4:44 pm Post subject: |
|
|
Hi Guys,
I wasn't expecting that ! (MOSI, MISO not used)
I am away from home at the moment but will try this again on Thursday.
Many thanks for your replies,
Anton |
|
Back to top |
|
 |
Anton
Joined: 19 Apr 2005 Posts: 51 Location: United Kingdom
|
Posted: Mon May 30, 2005 2:08 am Post subject: |
|
|
Hi,
I thought I had responded to this. I must have not submitted it properly as I was in a rush.
This worked perfectly on my first attempt after re-mapping the pins for the STK Programmer, as described above.
Thanks,
Anton |
|
Back to top |
|
 |
|