ATmega1284P With Arduino

Discussion specific to the 24-pin ZX microcontrollers, e.g. ZX-24r, ZX-24s and ZX-24t.
Post Reply
geocool
Posts: 15
Joined: 04 May 2011, 9:38 AM

ATmega1284P With Arduino

Post by geocool »

Hello.
I would like to know if it's possible to install arduino bootloader and use it's programming language wiring. I Read that there are ports of arduino bootloader for ATmega1284P.
If it's possible can somebody show me the way ?

*Using ZX 24s.

Thanks in advance.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ATmega1284P With Arduino

Post by dkinzer »

geocool wrote:I would like to know if it's possible to install arduino bootloader [on a ZX-24s] and use it's programming language wiring.
In short, yes. Note, however that the 24-pin ZX devices do not provide access to all 32 I/O pins so it is likely that you'll have to invent your own Arduino-like pin numbering scheme for the pins that are available.

Note, also, that programming the Arduino bootloader erases the ZBasic bootloader - the device will no longer be a ZX-24s.
geocool wrote:I Read that there are ports of arduino bootloader for ATmega1284P.
There appears to be several; search the Internet for the keyword Calunium. At first glance, it looks well done.
- Don Kinzer
geocool
Posts: 15
Joined: 04 May 2011, 9:38 AM

Post by geocool »

Ok i did a little bit of research and also got support on another forum.
They told me that:
"The heart of the ZX-24s is the Atmel AVR ATmega1284P microcontroller running at 14.7MHz."

That is not quite compatible with Arduino - can you change it to 16 MHz?
Also they told me to use this : https://github.com/maniacbug/mighty-1284p

Do i have to make change is in the ATmegaBOOT.c for the ports and compile it ? I don't actually now what changes i have to do.

Also can i burn bootloader to zx from Parallax board of education or do i need other stuff like avr programmers ?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

"The heart of the ZX-24s is the Atmel AVR ATmega1284P microcontroller running at 14.7MHz."
It is true that some parts of the Arduino code (e.g. millis) are hard coded assuming a 16MHz clock rate but for many other parts the clock rate is not critical. Unless you have SMT rework skills, changing the surface mount crystal of a ZX-24s to 16MHz is impractical.
geocool wrote:Do i have to make change is in the ATmegaBOOT.c for the ports and compile it ? I don't actually now what changes i have to do.
Parts of the code are dependent on the clock speed. In a bootloader, typically the UART initialization is speed dependent so you'd have to change that part. There may be other changes required. You'll have to read through the code, make sure you understand what each part does, and make any necessary changes.
geocool wrote:Also can i burn bootloader to zx from Parallax board of education or do i need other stuff like avr programmers ?
You will need a AVR programmer that is capable of flashing a mega1284P (not all are). Further, you'll have to make a cable adapter to connect the programmer to the programming pins of the ZX-24s (along the end of the board between pins 1 and 24 - see the ZX-24 series schematic). Pololu p/n 1238 may be useful in this regard.

This type of project requires substantial skills and knowledge. Since no one has done it before you're going to be pretty much on your own. In the end, it may turn out to be impossible or impractical.
- Don Kinzer
Post Reply