Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Loading Software for MonoChron
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Loading Software for MonoChron

by virtualeb on Sun Apr 25, 2010 8:58 am

Hi - I purchased a Monochron PCB and stuffed it with the components. It has a ATMEGA328-PU which I purchased from a supplier. Can someone please help me get the software loaded on it? I am using a usbtiny which I know is good. Can I use the Arduino 018 to load the necessary boatloader and other software? :?

virtualeb
 
Posts: 7
Joined: Wed Feb 17, 2010 10:59 am

Re: Loading Software for MonoChron

by adafruit on Sun Apr 25, 2010 9:39 pm

no, it is not an Arduino project. you will have to program the AVR with avr-gcc. all of the firmware is on github.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Loading Software for MonoChron

by virtualeb on Tue Jun 01, 2010 6:43 pm

Hi,

I finally have the usbtiny programmer working with the Monochron. I downloaded the program
files from Github. What commands do I have to issue to send the firmware to monochron?
I tried

1) Make

followed by

2) Make program

After that all I get is a Blue screen on the Monochron. I appreciate any feedback.
I am using manufacturer supplied m328p

I have attached my results:


C:\dataman-IntruderChron-84d5780>cd firmware

C:\dataman-IntruderChron-84d5780\firmware>make
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=i2c.lst -std=gnu99 i2c.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > i2c.d; \
[ -s i2c.d ] || rm -f i2c.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=ks0108.lst -std=gnu99 ks0108.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > ks0108.d; \
[ -s ks0108.d ] || rm -f ks0108.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=glcd.lst -std=gnu99 glcd.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > glcd.d; \
[ -s glcd.d ] || rm -f glcd.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=util.lst -std=gnu99 util.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > util.d; \
[ -s util.d ] || rm -f util.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=anim.lst -std=gnu99 anim.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > anim.d; \
[ -s anim.d ] || rm -f anim.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=buttons.lst -std=gnu99 buttons.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > buttons.d; \
[ -s buttons.d ] || rm -f buttons.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=config.lst -std=gnu99 config.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > config.d; \
[ -s config.d ] || rm -f config.d
set -e; avr-gcc -MM -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfi
elds -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-
adhlns=ratt.lst -std=gnu99 ratt.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > ratt.d; \
[ -s ratt.d ] || rm -f ratt.d

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Compiling: ratt.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=ra
tt.lst -std=gnu99 -DTXMODE= ratt.c -o ratt.o
In file included from ratt.c:11:
ratt.h:208: warning: function declaration isn't a prototype

Compiling: config.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=co
nfig.lst -std=gnu99 -DTXMODE= config.c -o config.o
In file included from config.c:8:
ratt.h:208: warning: function declaration isn't a prototype
config.c: In function 'display_menu':
config.c:59: warning: implicit declaration of function 'print_date'
config.c:60: warning: implicit declaration of function 'print_region_setting'
config.c: At top level:
config.c:145: warning: conflicting types for 'print_date'
config.c:59: warning: previous implicit declaration of 'print_date' was here
config.c:437: warning: conflicting types for 'print_region_setting'
config.c:60: warning: previous implicit declaration of 'print_region_setting' wa
s here

Compiling: buttons.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=bu
ttons.lst -std=gnu99 -DTXMODE= buttons.c -o buttons.o
In file included from buttons.c:8:
ratt.h:208: warning: function declaration isn't a prototype

Compiling: anim.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=an
im.lst -std=gnu99 -DTXMODE= anim.c -o anim.o
In file included from anim.c:12:
ratt.h:208: warning: function declaration isn't a prototype
anim.c:73: warning: function declaration isn't a prototype
anim.c: In function 'crand':
anim.c:127: warning: control reaches end of non-void function

Compiling: util.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=ut
il.lst -std=gnu99 -DTXMODE= util.c -o util.o

Compiling: glcd.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=gl
cd.lst -std=gnu99 -DTXMODE= glcd.c -o glcd.o
glcd.c: In function 'glcdFillRectangle':
glcd.c:107: warning: unused variable 'bitsleft'

Compiling: ks0108.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=ks
0108.lst -std=gnu99 -DTXMODE= ks0108.c -o ks0108.o

Compiling: i2c.c
avr-gcc -c -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpa
ck-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=i2
c.lst -std=gnu99 -DTXMODE= i2c.c -o i2c.o

Linking: monochron.elf
avr-gcc -mmcu=atmega328p -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-
struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=ratt.
o -std=gnu99 ratt.o config.o buttons.o anim.o util.o glcd.o ks0108.o i2c.o --
output monochron.elf -Wl,-Map=monochron.map,--cref

Creating load file for Flash: monochron.hex
avr-objcopy -O ihex -R .eeprom monochron.elf monochron.hex

Creating load file for EEPROM: monochron.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex monochron.elf monochron.eep
c:\WinAVR-20100110\bin\avr-objcopy.exe: --change-section-lma .eeprom=0x00000000
never used

Creating Extended Listing: monochron.lss
avr-objdump -h -S monochron.elf > monochron.lss

Creating Symbol Table: monochron.sym
avr-nm -n monochron.elf > monochron.sym

Size after:
monochron.elf :
section size addr
.data 1066 8388864
.text 19288 0
.bss 150 8389930
.debug_aranges 640 0
.debug_pubnames 3117 0
.debug_info 19588 0
.debug_abbrev 8156 0
.debug_line 18427 0
.debug_frame 2208 0
.debug_str 3467 0
.debug_loc 8704 0
.debug_ranges 848 0
Total 85659



Errors: none
-------- end --------


C:\dataman-IntruderChron-84d5780\firmware>make program
avrdude -p atmega328p -P com5 -c usbtiny -B 1 -U flash:w:monochron.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "monochron.hex"
avrdude: input file monochron.hex auto detected as Intel Hex
avrdude: writing flash (20354 bytes):

Writing | ################################################## | 100% 4.89s



avrdude: 20354 bytes of flash written
avrdude: verifying flash memory against monochron.hex:
avrdude: load data flash data from input file monochron.hex:
avrdude: input file monochron.hex auto detected as Intel Hex
avrdude: input file monochron.hex contains 20354 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 3.56s



avrdude: verifying ...
avrdude: 20354 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.


C:\dataman-IntruderChron-84d5780\firmware>

virtualeb
 
Posts: 7
Joined: Wed Feb 17, 2010 10:59 am

Re: Loading Software for MonoChron

by adafruit on Tue Jun 01, 2010 8:52 pm

could be something else is soldered wrong

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Loading Software for MonoChron

by virtualeb on Tue Jun 01, 2010 9:14 pm

Silly me. I just got Intruderchron to work. Had to adjust the contrast. This is a scream. :lol:

virtualeb
 
Posts: 7
Joined: Wed Feb 17, 2010 10:59 am

Please be positive and constructive with your questions and comments.