Show Posts
|
|
Pages: [1]
|
|
1
|
Using Arduino / Microcontrollers / Re: Standalone Atmega328p-au
|
on: April 17, 2013, 01:42:26 am
|
|
Dear CrossRoads,
thank you very much for the answer. I modified my wiring sketch (attachment) according to your advice. Is this correct now? I will include ICSP header with MISO, MOSI, RESET, SCK, VCC and GND (as shown in the wiring sketch). And after burning the bootloader (I was thinking of buying AVRISP mkII), I can upload sketches via a FTDI using VCC, GND, RX, TX and DTR. The difference between DTR (software reset) and RESET is only the 0.1 uF capacitor?
I am using only 3 PWM outputs and I2C lines (SDA, SCL). Do I need AREF wired in this case? The same two pins are also used for analog input (but are in my case configured as I2C).
Thank you again, K
P.S.: Yes, VCC is 5V.
|
|
|
|
|
2
|
Using Arduino / Microcontrollers / Re: Standalone Atmega328p-au
|
on: April 16, 2013, 09:02:02 am
|
|
I am attaching the relevant schematics.
Can I use Arduino Nano (atmega328p-au) first to burn the bootloader to a blank atmega328p-au using the VCC, GND, MISO, MOSI, SCK and SS (to RESET) pin and then use a FTDI adapter to program the bootloaded chip using the TX, RX, RESET, VCC and GND pins? Is the schematic diagram correct, since I did not use a capacitor on the reset?
Best regards, K
|
|
|
|
|
3
|
Using Arduino / Microcontrollers / Standalone Atmega328p-au
|
on: April 16, 2013, 05:29:01 am
|
Dear all, I have been reading about the atmega328 family and now I am more confused about this than before. I will be using a standalone atmega328p-au, where p stands for picopower (less power consumption), and au stands for tqfp. I hope I am correct so far? I need to burn the arduino bootloader on the blank chip, because I need to be able to upload the code whenever necessary. Once the bootloader is burnt on the chip I will only have (direct) access to Rx, Tx, Vcc, Vgnd and RST pins. I need some advice on how to burn the bootloader (and upload sketches) using this method: http://arduino.cc/en/Tutorial/ArduinoToBreadboard. Since the Uno atmega328p-pu (28 pins) is different from atmega328p-au (32 pins), will it be possible to use the optiboot bootloader? Do the two chips have different signatures? Arduino Nano v3.0 has the same chip I will be using. So I can just select Arduino Nano board to burn the bootloader using the same method? I have seen some vague answers on this topic, but did not find any straightforward answer. Thank you for your help and best regards, K
|
|
|
|
|
4
|
Using Arduino / Microcontrollers / Re: atmega328p reset on power startup
|
on: April 05, 2013, 05:38:47 am
|
|
Dear Mr. Gammon and dc42,
thank you for the help. I intend to use ICSP to program my chip via Arduino, but what I needed to know is that power-on is also a reset condition. I will also try to use watchdog timer as a reset method during the operation.
Thank you and best regards, K
|
|
|
|
|
5
|
Using Arduino / Microcontrollers / atmega328p reset on power startup
|
on: April 05, 2013, 12:39:21 am
|
|
Dear all,
could you please offer some explanation to my following question:
If I understand correctly, the reset pin on atmega328p has to be pulled low in order to reset the uC? On Arduino Uno, the atmega16U2 is responsible for resetting the atmega328p in order to upload new sketches right?
What about on power-up (plugging the Arduino to a power source)? The controller also resets? How is this performed?Does it have an internal reset?
I would like to have a standalone atmega328p on another board and program it via the Arduino Uno (using the Arduino bootloader). Once the chip is bootloaded, only Rx,Tx, RESET, VCC and GND are needed to do this.
My main question: If I program the atmega328p chip via Arduino Uno and then remove the Uno and unplug the atmega328p from power, what will happen, when I power the atmega328p back on as a standalone chip? Will it reset and start normally? If not, could you please explain what should I do to achieve this?
Thank you and best regards, K
|
|
|
|
|
7
|
Using Arduino / Networking, Protocols, and Devices / Serial event
|
on: March 23, 2013, 12:22:20 pm
|
Dear readers, My question is probably silly, since I must be missing something, but here goes... I am using Serial event to receive data on Arduino Uno which I send from my PC (please see the attached image). The procedure is: I use floating point numbers (0.1 precision), which I multiply by 10 and cast them to 16-bit value. I split the value to 2x8 bits, which I send over the serial port. The Arduino code is: byte received_data[4]; boolean received_all_data = false; float Tlimit_down = 0.0; float Tlimit_up = 0.0;
void setup() { Serial.begin(115200); }
void loop() { if(received_all_data) { Serial.println(Tlimit_down); Serial.println(Tlimit_up); received_all_data = false; } }
void serialEvent() { while(Serial.available() < 4){} for(int i=0;i<4;i++) { received_data[i] = Serial.read(); } Tlimit_down = (float)((received_data[0] << 8) + (received_data[1]))/(10.0); Tlimit_up = (float)((received_data[2] << 8) + (received_data[3]))/(10.0); received_all_data = true; } After the data is read in full, I return it to the serial port and read it on my PC (see the read buffer box on the attached image). Since the Tlimit_up and Tlimit_down are global variables, I change them every time I send new data to the serial port form my PC, right? So if I put another Serial.println as follows: void loop() { if(received_all_data) { Serial.println(Tlimit_down); Serial.println(Tlimit_up); received_all_data = false; } [b]Serial.println(Tlimit_up);[/b] } And after closing the serial port with the PC and opening the Serial monitor in Arduino, the output should have the last value I've sent through the serial port, right? Even though I closed the serial port. But the output is always 0.00! Could please someone help me with this? Is this happening because I close the serial port? Because in the read buffer (attached image) the values seem to be correct... Thank you and best regards, K
|
|
|
|
|
8
|
Using Arduino / Microcontrollers / Re: Programming Atmega328
|
on: March 23, 2013, 11:42:30 am
|
Thank you for your answers! I really appreciate the responsiveness and tolerance.  I'm still not clear on why you're planning to use 20MHz. Nothing you've said seems to need it, so if it's going to cause problems then why do it?
I am using an I2C IR array temperature sensor and I am trying to achieve as highest framerate as possible with Atmega328 chip. I believe I cannot optimize my code any further (also using lookup tables). I already achieve < 10 ms refresh rate, but I am trying to go even lower. In my opinion this is one option. The other (not to my liking, but would resolve my problems for sure) is using 32-bit controller. I have no idea how to program 32-bit controllers and the libraries I am using only work with 8-bit AVR chips. So you are saying that there will be problems if trying to achieve 20MHz? What about alternatives? Atmel Studio for example? Could you please suggest something, since you have a great deal more experience than me... According to the datasheet, Atmega328 can achieve 20MHz. So it is only possible to get 16, 8, 4, 2 or 1 MHz clock with Arduino bootloader? Sincerely, K
|
|
|
|
|
9
|
Using Arduino / Microcontrollers / Re: Programming Atmega328
|
on: March 19, 2013, 06:49:06 am
|
This is the boards.txt file for Arduino Uno with Atmega328. #uno.name=Arduino Uno uno.upload.protocol=arduino uno.upload.maximum_size=32256 uno.upload.speed=115200 uno.bootloader.low_fuses=0xff uno.bootloader.high_fuses=0xde uno.bootloader.extended_fuses=0x05 uno.bootloader.path=optiboot uno.bootloader.file=optiboot_atmega328.hex uno.bootloader.unlock_bits=0x3F uno.bootloader.lock_bits=0x0F uno.build.mcu=atmega328p uno.build.f_cpu=16000000L uno.build.core=arduino uno.build.variant=standard
Here I can change the f_cpu=16000000L from 16 to 20MHz. What about the "bootloader.file=optiboot_atmega328.hex" dependency? I still think I need to rebuild the hex file... Or is the change in boards.txt enough? Best regards, K
|
|
|
|
|
10
|
Using Arduino / Microcontrollers / Re: Programming Atmega328
|
on: March 19, 2013, 05:45:20 am
|
I really appreciate your prompt answer. So basically I just need to set up my Atmega like shown here: http://arduino.cc/en/Tutorial/ArduinoISP? And burn the bootloader? How can I determine the clock frequency? If I use internal clock with the Arduino bootloader, the clock frequency would surely be set to 16MHz? What if I use an external oscillator at 20MHz? It seems I would need to rebuild the bootloader? Thank you and best regards, K
|
|
|
|
|
11
|
Using Arduino / Microcontrollers / Programming Atmega328
|
on: March 19, 2013, 04:13:17 am
|
Dear readers, I am aware this topic has been covered and I have been looking all around for an answer to my question. It seems I do not understand this. Could you please point me in the right direction and shed some light on my problem as follows: I am using Arduino Uno (and Nano) with Atmega328 to communicate with a sensor through I2C communication using i2cmaster library ( http://homepage.hispeed.ch/peterfleury/avr-software.html). This is the only library I am using. As far as I understand, the Atmega328 clock frequency is 20MHz, but Arduino uses only 16MHz oscillator, mainly because of the libraries (timing). I am trying to build a controller using an Atmega328-TQFP only for I2C communication only. Can I program the Atmega328-TQPF with Arduino Uno and using 20MHz oscillator form my project? I saw a tutorial for bootloading the Atmega328 chip (the DIP package) which is simple to connect using a breadboard. The tutorial also uses a16MHz oscillator. Why not 20MHz? Because of the Arduino libraries? What would be the best way to program the Atmega328-TQPF? I found one that already has Arduino bootloader ( http://www.jayconsystems.com/atmega328p-with-arduino-uno-bootloader.html). I would like to burn the bootloader myself through Arduino. Would I need to build a board and burn the bootloader directly? Thank you for any help an suggestion. Best regards, K
|
|
|
|
|
12
|
Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array
|
on: December 03, 2012, 03:30:43 pm
|
|
Hello!
First, i would like to thanks maxbot for sharing his experience with mlx 90620 and arduino. It has helped me a great deal with setting up my own communication.
I have a couple of questions though:
1. when calculating ta (sensor temp) coefficients i noticed that one should first do a sign check and then divide the result and not the other way around 2. it was mentioned that max refresh rate is 0.5 to 64 Hz.The documentation states that maximum refresh rate is 512 Hz. 3. when calculating the to (object temp) i noticed that alpha_ij is declared as a constant.where is this value from?this value should be calculated for each individual pixel. 4. could you be so kind to explain the check configuration register function (CFG_MSB & 0x40) == 0?
Thank you again and best regards, K
|
|
|
|
|