Hi,
Can you use plain wire jumpers to connect the XMEGA board programmer connector and the CODEGRIP Connector ?
Regards,
Filip.
can't connect mikroBootloader to XMEGA 128A1 board
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Hi, Filip, tnx for answer.
Sorry, I don't understand what you mean.
Played around some more with the ATXMega128a1 board and the codeGrip but didn't things get to work.
I placed the ATXMega128a1 aside and took an ATMEGA2560 and connected ( I made an adapter) via 6 pin header to the codeGrip ADAPT.
Managed to write a .hex into the 2560 by CODEGRIP Suite 'protocol: ISP'.
250kHz works, 500kHz doesn't. ( no problem)
Next thing I'm gonna do ( with the 2560 ) is using the JTAG option in CODEGRIP Suite 'protocol'.
Firts make an adapter and try 2560 and JTAG.
To be continued.
Sorry, I don't understand what you mean.
Played around some more with the ATXMega128a1 board and the codeGrip but didn't things get to work.
I placed the ATXMega128a1 aside and took an ATMEGA2560 and connected ( I made an adapter) via 6 pin header to the codeGrip ADAPT.
Managed to write a .hex into the 2560 by CODEGRIP Suite 'protocol: ISP'.
250kHz works, 500kHz doesn't. ( no problem)
Next thing I'm gonna do ( with the 2560 ) is using the JTAG option in CODEGRIP Suite 'protocol'.
Firts make an adapter and try 2560 and JTAG.
To be continued.
To DIY or not to DIY
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
YES!
Got my ATXmega128a1 programmed by 'protocol: PDI and by 500kHz ).
My DIY adapter for the ATmega2560, was also suitable for the ATXmega128a1 board.
Now the real work kan begin: CODING my ATXmega128a1's!
Thanks for your time, Filip!
Kind regards from the Netherlands! Marcel
Got my ATXmega128a1 programmed by 'protocol: PDI and by 500kHz ).
My DIY adapter for the ATmega2560, was also suitable for the ATXmega128a1 board.
Now the real work kan begin: CODING my ATXmega128a1's!
Thanks for your time, Filip!
Kind regards from the Netherlands! Marcel
To DIY or not to DIY
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Something wrong!
I coded this:
Doc shows 8MHz:
Scope should show prox 100Hz, but shows 50Hz.
I also checked the pcb itself, and it shows an 8MHz cristal.
To be continued...
I coded this:
Doc shows 8MHz:
Scope should show prox 100Hz, but shows 50Hz.
I also checked the pcb itself, and it shows an 8MHz cristal.
To be continued...
To DIY or not to DIY
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Did put the ATXmega128a1 aside and took 2 ATmega2560's.
One I programmed ( as always before ) by USB, the other by the codegrip.
Did use exactly the same hex-file.
Now the 2560 programmed by the codegrip is off, too as by the ATXmega128a1.
The usb one is ok, shows 100Hz ( as always before )
Here in a picture:
The 'yellow one' is way off.
Kind regards!
One I programmed ( as always before ) by USB, the other by the codegrip.
Did use exactly the same hex-file.
Now the 2560 programmed by the codegrip is off, too as by the ATXmega128a1.
The usb one is ok, shows 100Hz ( as always before )
Here in a picture:
The 'yellow one' is way off.
Kind regards!
To DIY or not to DIY
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Can I set fuse-bits to create the desired clockspeed?
To DIY or not to DIY
Re: can't connect mikroBootloader to XMEGA 128A1 board
Hi,
If I understand correctly, the clock is not set properly in regards to the parameters given in the project ?
Regards,
Filip.
If I understand correctly, the clock is not set properly in regards to the parameters given in the project ?
Regards,
Filip.
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Hi, Filip.
Yes, the clock is wrong by a factor 8 or 16 ( 2^n )
When I'm right, the initial clock of the atxmega128a1 is 2MHz.
An should be able to set at 8Mhz or 32Mhz.
Gonna do/check the same with 2 ATmega328P boards, as I did with 2 atmega2560.
Kind regards!
Yes, the clock is wrong by a factor 8 or 16 ( 2^n )
When I'm right, the initial clock of the atxmega128a1 is 2MHz.
An should be able to set at 8Mhz or 32Mhz.
Gonna do/check the same with 2 ATmega328P boards, as I did with 2 atmega2560.
Kind regards!
To DIY or not to DIY
Re: can't connect mikroBootloader to XMEGA 128A1 board
Hi,
To set the clock to 32MHz, use the following code:
Regards,
Filip.
To set the clock to 32MHz, use the following code:
Code: Select all
OSC_CTRL := 0x02;
while RC32MRDY_bit = 0 do nop;
CPU_CCP := 0xD8;
CLK_CTRL := 1;
Filip.
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Thanks a lot, Filip!
And I think, your code-example will give me enough courage to handle the clock speed of other processors!
Kind regards!
And I think, your code-example will give me enough courage to handle the clock speed of other processors!
Kind regards!
To DIY or not to DIY
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: can't connect mikroBootloader to XMEGA 128A1 board
Hi,
started trying to get my ATMEGA2560 at right clockfrequence as well.
The clock is set at 16MHz in projectsettings in mikroPascal for AVR.
The code is just a square-wave at 10kHz.
Writing the .hex via xloader gives a 10kHz on oscilloscope.
Writng the .hex via codeGrip gives 620 Hz. Thats off in a factor 16 ( 10k / 620 ).
What I did so far:
I consulted the 2560-datasheet and Iadded at the very beging of my code:
CLKPR:= %10000000; // = CLKPR.7 is CLKPCE-bit
CLKPR:= %00000000;
Now I get 5KHz, still factor 2 off.
Here shown:
Also played the CAL7-bit in OSCCAL-register but that was a misassumption!
I hope somebody can help me.
Tnx in advance, kind regards. Marcel
started trying to get my ATMEGA2560 at right clockfrequence as well.
The clock is set at 16MHz in projectsettings in mikroPascal for AVR.
The code is just a square-wave at 10kHz.
Writing the .hex via xloader gives a 10kHz on oscilloscope.
Writng the .hex via codeGrip gives 620 Hz. Thats off in a factor 16 ( 10k / 620 ).
What I did so far:
I consulted the 2560-datasheet and Iadded at the very beging of my code:
CLKPR:= %10000000; // = CLKPR.7 is CLKPCE-bit
CLKPR:= %00000000;
Now I get 5KHz, still factor 2 off.
Here shown:
Code: Select all
program clock2560;
begin
{
ORIGINAL CODE:
while true do
begin
portL:= 255;
delay_us(50);
portL:= 0;
delay_us(50);
end;
programming via USB gives prox 10 kHz, is OK!
programming via codeGrip gives prox 620 Hz, NOT ok!
factor-off = 10k / 620 = 16
}
// adding following 2 lines
CLKPR:= %10000000; // = CLKPR.7 is CLKPCE-bit
CLKPR:= %00000000;
{ gives 5kHz
tested some more:
%00000001 gives 2500 Hz
%00000010 gives 1250 Hz
%00000011 gives 620 Hz
%00000100 gives 310 Hz
}
DDRL:= 255; // portL as output
while true do
begin
portL:= 255;
delay_us(50);
portL:= 0;
delay_us(50);
end;
end.
Also played the CAL7-bit in OSCCAL-register but that was a misassumption!
I hope somebody can help me.
Tnx in advance, kind regards. Marcel
To DIY or not to DIY