Pages: [1]   Go Down
Author Topic: SD card PCB supporting hex files created for Arduino UNO  (Read 821 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am currently working on SD card programming with Arduino UNO. Most of the things are going all fine at the moment. However, I need to design a PCB (due to space requirements. I can not use a whole Arduino UNO development board (too large) for the system i am working on.) in which i would use an ATMEGA328 chip and all i want is that: Create a hex file via Arduino UNO for the SD card and load the code to my newly designed PCB using AVR studio. That's why all the pins and layouts in the new PCB must be compatible (at least 'almost') with Arduino UNO.

Do you have any suggestions for how to start and what to take account of while dealing for such a system? Also if there already exists similar systems, please let me know. So that i can start working on them in the first place.

Best Regards,

Fatih
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually I know which pins to use for the Atmega328P-PU part. However, just to make the hex file suitable for the chip alone (which is on a new pcb) do i have to consider about the other microcontroller (Atmega8 u2)? Does anybody something similar before?

Thank you
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, by moving my setup on a breadboard i become successful to run the code and have the output via serial port. As Arduino using an external oscillator of 16Mhz, i also integrated an external oscillator of the same frequency. However, -maybe due to wrong settings applied for sut_cksel- i can read the output not with a baud rate of 9600 but 4800 (the code should be running with a baud rate of 9600).

I first try to set the sut_cksel to a setting with something like 16Mhz ... but i could not find any line referring to that. Thus, i tried choosing "Ext. Crystal Osc. 8.0-    Mhz; Startup time PWR DWN/RESET: 16K CK/14CK +0ms"

All i hope is that this setting is wrong and i am looking forward to receive any suggestions to configure this setting.

Best regards,

Fatih
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 437
Posts: 23700
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://store.nkcelectronics.com/arduino-runtime-board-rev-b.html

Build yourself up a little card like this and connect your SD card to it.
Run it from 3.3V and 8 MHz, no special hardware adaptions will be needed to connect with the SD card.

If you want it even smaller, use a 3.3V Promini.

In either case, connect the SD card's VCC to the 3.3V power source directly.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Leeds, UK
Offline Offline
Edison Member
*
Karma: 71
Posts: 1641
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For 16MHz, that is the correct setting.

Have you set the U2X bit? (It doubles the UART baud rate).
Logged

~Tom~

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you set the U2X bit? (It doubles the UART baud rate).

I think I don't. How to set this?

Thanks in advance.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://store.nkcelectronics.com/arduino-runtime-board-rev-b.html

Build yourself up a little card like this and connect your SD card to it.
Run it from 3.3V and 8 MHz, no special hardware adaptions will be needed to connect with the SD card.

If you want it even smaller, use a 3.3V Promini.

In either case, connect the SD card's VCC to the 3.3V power source directly.

Thank you for the info!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, at the moment, I can create a .hex file from Arduino and upload it to my seperate Atmega328 chip via AVRstudio using an external oscillator of 16Mhz. Now the baud rate is also the same (9600) with the proper settings.

Now, what i want is that, create the .hex file in the Arduino GUI as if Arduino UNO is using 8Mhz of its internal oscillator other than the 16Mhz of the external. So that i will not need to add an additional external oscillator to my seperate PCB and use Atmega's internal oscillator (8MHz). Therefore, what settings do i have to change in the Arduino code?

Thank you.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at the file "boards.txt" - it defines the settings for the various boards.  You can either find one in there that matches your configuration and use that, or create your own entry.

The file (if I remember right) is in the hardware folder of the IDE code - if not, have a look around in there somewhere for it.
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I tried using the board settings as if i am using an Arduino Mini (8Mhz), and it works well now.

At the moment all i have to solve is writing log files to SD card that are sent with 115200 baud rate from a wireless telemetry unit. I am now looking at similar projects. If anyone gives further information that'll be appreciated. (Also I wonder how to change parity value from 'none' (default) to 'even' in the Arduino)

Regards,

Fatih
Logged

Pages: [1]   Go Up
Jump to: