Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Memory Usage on: October 31, 2013, 02:40:06 pm
Question, trying to save memory. I had a program that had all the variables and functions in one ino file. I have since then move several to classes that are used in specific functions in the ino file. So, when a class is used in a function vs have it in the main ino file does the class get loaded when the function get called and then release when the function end. I moved them to classes to make it easier to maintain.

Thanks
2  Using Arduino / Project Guidance / Sharing SD Card Module not a Shield on: March 27, 2013, 03:37:51 pm
I have a project that I created that used an SD Card Module. I have another project that will have it's own Micro Controller. Is it possible for the 2 projects to share the same SD Card Module. If so am I correct that both micro controllers SCK, MISO, & MOSI would all be connected to the same pin, but for the CS pin would does it matter what pin they use say 10, & 4?

Thanks
Scott 
3  Using Arduino / Programming Questions / Re: How to convert byte of data to individual button presses? on: February 05, 2013, 08:01:56 pm
Then he still has to code for ever combination of all possible combinations. Doesn't he?
4  Using Arduino / Programming Questions / Re: Need help exit for(;;) on: February 05, 2013, 07:58:59 pm
How are you expecting the value to change?
5  Using Arduino / Programming Questions / Re: How to convert byte of data to individual button presses? on: February 05, 2013, 05:13:45 pm
I'm sure thats true, but he said "returns what button was pressed" not buttons were pressed.
6  Using Arduino / Programming Questions / Re: How to convert byte of data to individual button presses? on: February 05, 2013, 04:04:48 pm
You don't need 255.  If you do it the smart way you only need 8.

Which is what I have, you have to test with if then else logic anyways.
7  Using Arduino / Programming Questions / Re: How to convert byte of data to individual button presses? on: February 05, 2013, 03:51:50 pm
Can you just do something like this

switch (byte) {
case 10000000:
   ....
   ....
   break;
case 1000000:
   ....
   ....
   break;
case 100000:
   ....
   ....
   break;
case 10000:
   ....
   ....
   break;
case 1000:
   ....
   ....
   break;
case 100:
   ....
   ....
   break;
case 10:
   ....
   ....
   break;
case 1:
   ....
   ....
   break;
default:
   ....
   ....
   break;
}




8  Using Arduino / Programming Questions / Re: Need help exit for(;;) on: February 05, 2013, 10:43:25 am
I think what you are trying to do would require an interrupt. you appear to want to run a loop and display a value and then if that value changes it would be displaying the new value. I could be wrong but I too am still learning the Arduino. you will have to have the variable you want to display define as a global as volitile so that the interrup function could change the value. My understanding is that when am interrupt is called all control does to the interrupt function and all current processing stops until the interrupt function is completed, at which time the process continues. Hopes this helps.
9  Using Arduino / Programming Questions / Re: 2Boots Compile warnings on: February 05, 2013, 10:28:03 am
Bumping this back to the top, still looking for an answer.
10  Using Arduino / Programming Questions / Timer Interrupts on: February 05, 2013, 10:26:53 am
I am using timer interrupts, and I have a question when to you issue noInterrupts() does this stop the count flags or do the count flag or do they keep getting incremented and reset  or does all that stop.
11  Using Arduino / Programming Questions / 2Boots Compile warnings on: February 04, 2013, 11:00:11 am
All,

I am compiling 2boots on ubuntu and am getting the following warning? Also if I am understanding the instructions right PD4 is digital pin 4 for the Chipselect. To use the SD Card Module on the Uno its Digital Pin 10. When I change the pin from PD4 to PD10 i get errors. but first I'm just trying the get it to compile and upload. When I try to upload the PD4 the flash.sh throws errors but it will upload the nommc one correctly. anyways here is the warnings. is this something I should be concerned about?

scott@ubuntu:~/embedded-master/avr/2boots$ make
[ -d build ] || mkdir build

----------[2boots-atmega328p-16000000L-nommc-board-arduino.hex]-------------------
Compiling 2boots for:
- board-arduino
- MCU:atmega328p @ 16000kHz
- MMC: nommc

avr-gcc -g -Wall -Os -funsigned-char -fno-split-wide-types -fno-inline-small-functions -mcall-prologues -ffunction-sections -fdata-sections -ffreestanding -combine -fwhole-program -fno-jump-tables -mmcu=atmega328p -DF_CPU=16000000L    -Wl,--section-start=.text=0x7800  -Wl,--relax -nostartfiles -Wl,-gc-sections board-arduino.c mmc_fat.c stk500v1.c prog_flash.c -o build/2boots-arduino-atmega328p-16000000L-nommc.elf
board-arduino.c: In function ‘main’:
board-arduino.c:62:45: warning: function with qualified void return type called
stk500v1.c: In function ‘handle_addr’:
stk500v1.c:236:3: warning: dereferencing type-punned pointer will break strict-aliasing rules

sucessfully compiled to build/2boots-arduino-atmega328p-16000000L-nommc.elf
   text      data       bss       dec       hex   filename
    832         0       135       967       3c7   build/2boots-arduino-atmega328p-16000000L-nommc.elf
avr-objcopy -j .text -j .data -O ihex build/2boots-arduino-atmega328p-16000000L-nommc.elf build/2boots-arduino-atmega328p-16000000L-nommc.hex   


----------[2boots-atmega328p-16000000L-PD4-board-arduino.hex]-------------------
Compiling 2boots for:
- board-arduino
- MCU:atmega328p @ 16000kHz
- MMC: PD4

avr-gcc -g -Wall -Os -funsigned-char -fno-split-wide-types -fno-inline-small-functions -mcall-prologues -ffunction-sections -fdata-sections -ffreestanding -combine -fwhole-program -fno-jump-tables -mmcu=atmega328p -DF_CPU=16000000L  -DMMC_CS=PD4 -DMMC_PORT=PORTD -DMMC_DDR=DDRD  -Wl,--section-start=.text=0x7800  -Wl,--relax -nostartfiles -Wl,-gc-sections board-arduino.c mmc_fat.c stk500v1.c prog_flash.c -o build/2boots-arduino-atmega328p-16000000L-PD4.elf
board-arduino.c: In function ‘main’:
board-arduino.c:62:45: warning: function with qualified void return type called
stk500v1.c: In function ‘handle_addr’:
stk500v1.c:236:3: warning: dereferencing type-punned pointer will break strict-aliasing rules

sucessfully compiled to build/2boots-arduino-atmega328p-16000000L-PD4.elf
   text      data       bss       dec       hex   filename
   2184         0       674      2858       b2a   build/2boots-arduino-atmega328p-16000000L-PD4.elf
avr-objcopy -j .text -j .data -O ihex build/2boots-arduino-atmega328p-16000000L-PD4.elf build/2boots-arduino-atmega328p-16000000L-PD4.hex   

-----[Size reports]----------------------------------------

   text      data       bss       dec       hex   filename
      0      2184         0      2184       888   build/2boots-arduino-atmega328p-16000000L-PD4.hex
      0       832         0       832       340   build/2boots-arduino-atmega328p-16000000L-nommc.hex


Thanks for your help.
12  Using Arduino / Programming Questions / Can this item be used to burn boot loader and sketches on: February 03, 2013, 08:02:45 pm
Does anyone know if this ebay item can be used to burn the bootloader and sketches to a standalone arduino. If so does anyone have any hookup diagrams?

http://www.ebay.com/itm/USBASP-USB-AVR-Programmer-for-Atmel-USB-ASP-USBISP-ISP-Arduino-Bootloader-USA-/150739530304?pt=LH_DefaultDomain_0&hash=item2318c6b240

Thanks
Scott
13  Using Arduino / Programming Questions / Re: 2Boots Question on: February 03, 2013, 07:58:47 pm
Sorry for that Actual file size. Also can the hex file be copied to windows in binary and use the Arduino IDE to burn to a board where the programmer is an Arduino as ISP unsing ladyada technique to load boot loader to a 328 chip with an arduino.
14  Using Arduino / Programming Questions / 2Boots Question on: February 03, 2013, 07:32:27 pm
? All,

when I run the make on ubuntu it generates the following files. my question is; does the size of the hex file matter?

ls -la build/*.hex
-rw-rw-r-- 1 scott scott 2374 Feb  3 15:39 build/2boots-arduino-atmega168-16000000L-nommc.hex
-rw-rw-r-- 1 scott scott 6183 Feb  3 15:39 build/2boots-arduino-atmega168-16000000L-PD4.hex
-rw-rw-r-- 1 scott scott 2374 Feb  3 15:39 build/2boots-arduino-atmega168-8000000L-nommc.hex
-rw-rw-r-- 1 scott scott 6183 Feb  3 15:39 build/2boots-arduino-atmega168-8000000L-PD4.hex
-rw-rw-r-- 1 scott scott 2374 Feb  3 15:39 build/2boots-arduino-atmega328p-16000000L-nommc.hex
-rw-rw-r-- 1 scott scott 6183 Feb  3 15:39 build/2boots-arduino-atmega328p-16000000L-PD4.hex
-rw-rw-r-- 1 scott scott 2399 Feb  3 15:39 build/2boots-arduino-atmega328p-8000000L-nommc.hex
-rw-rw-r-- 1 scott scott 6195 Feb  3 15:39 build/2boots-arduino-atmega328p-8000000L-PD4.hex
Pages: [1]