Go Down

Topic: SD card PCB supporting hex files created for Arduino UNO (Read 1 time) previous topic - next topic

Fisek

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

Fisek

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

Fisek

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

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Tom Carpenter

For 16MHz, that is the correct setting.

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

Fisek


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


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

Thanks in advance.

Fisek


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!

Fisek

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.

majenko

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.

Fisek

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

Go Up