Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
LDEVRIES
PostPosted: Jan 27, 2012 - 08:49 PM
Raving lunatic


Joined: May 04, 2007
Posts: 3529
Location: Geelong Australia, Home of the "Cats"

op wrote
Quote:
i also wrote this program in avr studio 4

LDEVRIES ASKED
Quote:
can you clarify if you actually wrote the code or not? We will then have a better understanding of your capabilities which makes it easier to help you.

NO RESPONSE!
jpmargis wrote (as you would expect)
Quote:
In the interest of full disclosure, the code posted by stavfot originally came from http://www.swcoder.co.uk/

Quote:
so what people? ok this code is not mine that is certain but what is the difference?


Recalling an earlier post from op
Quote:
is anybody going to give a straight answer or what the [deleted] am i doing in this [deleted] forum?! i start to believe that your profiles are fake and you are just the [deleted] profs that i have in the [deleted] university i study who no one tells anything to the students! they only know to get the pay checks every month! but when is about to do their duty no one do anything... just general advises of type "read this and read that and bla bla bla ..." no [deleted] straight answer...

so what is the purpose of prof? to tell the students to read? you think that they dont know that?

the purpose of the profs is to give specific knowledge not in general to say "read this manual and read that manual" and give general undefined answers.

do you really think that if i had the time i would be here waiting a straight answer? i would do it alone , but that is the problem, i dont have the time to do so ... i have other lessons to study to .. it is exams period can you understand that?

on top of that, if it was to go too read from the beginning everything so as to solve my questions what would be the purpose of that [deleted] forum? to demonstrate your knowledge ?

please if you are not going to give a straight answer dont bother to replay to my posts.. thanks!


You insult us and as it seems you are deceptive and can't provide straight answers, I'm out too!

_________________
Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
(If you haven't already done so, edit your PostNuke profile and let let us know where you are, what you do & what your interests are.)


Last edited by LDEVRIES on Jan 27, 2012 - 08:55 PM; edited 2 times in total
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
dksmall
PostPosted: Jan 27, 2012 - 08:52 PM
Raving lunatic


Joined: Apr 16, 2001
Posts: 3522
Location: Phoenix, Arizona

Well for starters your very first FlashAll call will blink the LEDs for 10ms, 3 times. That's probably too fast to see. Try changing it to flashAll(200, 10); and see if you get the LED's flashing. Until you can get that part working, I wouldn't even worry about other parts of the game. I'm not going to back over 10 pages to check for this, but you DO have the proper cables installed to attach the LED's to portB, right?
 
 View user's profile Send private message  
Reply with quote Back to top
stavfot
PostPosted: Jan 27, 2012 - 08:58 PM
Wannabe


Joined: Dec 15, 2011
Posts: 93


do you really think that i am not aware of this method?

to go a step every time and check and so on..

do you really think that i dont know what debugging is?

if i wanted ,as you say , i would have started doing debugging instead of arguing here. but the thing is that i prefer to ask some experienced members of this forum to tell me so as to save precious time. for them its a game to discover what is wrong just by taking a glance at the code.

so we come to the question what is the purpose of a forum?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jan 27, 2012 - 08:59 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62230
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

so we come to the question what is the purpose of a forum?

Are you saying you are ready for me to lock this thread on the road to nowhere?

Moderator

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
stavfot
PostPosted: Jan 27, 2012 - 09:01 PM
Wannabe


Joined: Dec 15, 2011
Posts: 93


yes of course i have check every single cable
 
 View user's profile Send private message  
Reply with quote Back to top
stavfot
PostPosted: Jan 27, 2012 - 09:03 PM
Wannabe


Joined: Dec 15, 2011
Posts: 93


no i am just saying that the reason of a forum is to help each other so as to solve specific problems.

providing and exchanging knowledge..

and hep beginners in avr

i am beginner in avr not in c++
 
 View user's profile Send private message  
Reply with quote Back to top
LDEVRIES
PostPosted: Jan 27, 2012 - 09:06 PM
Raving lunatic


Joined: May 04, 2007
Posts: 3529
Location: Geelong Australia, Home of the "Cats"

Johan wrote
Quote:
Apart from LDEVRIES testimony I still think there is a 50-50 chance we've been exquisitely trolled. Try that perspective for a minute, and you will see how this Copperfield'ean situation (mad prof, just mother suporting etc) would be a masterpiece of sorts.

You were right, only the odds were wrong! Wink

_________________
Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
(If you haven't already done so, edit your PostNuke profile and let let us know where you are, what you do & what your interests are.)
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
dksmall
PostPosted: Jan 27, 2012 - 09:26 PM
Raving lunatic


Joined: Apr 16, 2001
Posts: 3522
Location: Phoenix, Arizona

Stavot, I've been using this forum over a decade now. I can't count the 100's of times someone will say "my wiring is correct, what is wrong with my code?". The contributors here will make many suggestions and eventually the OP will find a problem with that wiring that was suppose to be correct. Trying to program an M128 with miso/mosi is a very common example. No one here knows your background, your experience with AVR's etc. Should I make the blind assumption that you have indeed attached a cable between J705 (PORTB) and J800 (LEDS)? Or should I mention it in case the OP has never used an STK500 and has no idea what cables to hook up, or that they even need to hookup cables.

In 11 pages of replies, have you mentioned that cable is attached?
In just this last page, you continue to reply with "the game doesn't work". How is that helpful?
What would be helpful is to say "the program starts and I see the first blinkall routine. After that, the buttons don't do anything"? A detailed comment like that would get you much further then "it don't work".

I guess I'm out as well.
 
 View user's profile Send private message  
Reply with quote Back to top
georges80
PostPosted: Jan 27, 2012 - 09:33 PM
Hangaround


Joined: Jul 25, 2004
Posts: 201
Location: Sunnyvale, CA

stavfot wrote:
do you really think that i am not aware of this method?

to go a step every time and check and so on..

do you really think that i dont know what debugging is?



I'd say we have pretty good evidence that you don't know what debugging is or are too lazy to do it for yourself.

Good luck, it's been entertaining to check in on the train wreck a few times per day.

cheers,
george.
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jan 27, 2012 - 11:34 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21251
Location: Orlando Florida

In ol stavfot's defense, he DID post a picture of his 8515 in the correct socket in the stk500, with the portb and portd ribbon cables attached to the switch and led headers. I was interested in whether the 8515 was in the right socket, so I specifically asked, and he posted the picture.

Cliff... is including <stdlib.h> the only hoop to jump thru to get malloc linked in? No -D or editing of a makefile to include a lib? Is it really that simple? I wonder how swcoder got the delay_ms(ms) to compile?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
stavfot
PostPosted: Jan 27, 2012 - 11:57 PM
Wannabe


Joined: Dec 15, 2011
Posts: 93


dksmall you dint even show up and you are out ?

you absence will be so apparent!
i am really going to miss all of your helpful guidance and advises and knowledge that you gave me so kindly.

to all the guys that are out i have to say:

guys i am really going to miss you! your contribution was so great! you really helped me!... to spent my time with out a reason .... maybe that was your purpose from the beginning.. and really! how would i know that i could trust some people behind fake pictures? you might be some "fellow" gang members from my university. because i have come to the conclusion that in the university i study there are no real students but gang members...as well as there are no real profs but gang leaders too ,who manipulate the gang members...(the so called students).. hahahaha

as for the prof (the godfather),who might be one of you...,and who assigned to me this project just because he dont want to do his duties well, teaching in time every weekend and not to be absent for the whole semester because he works in germany, and more over he indirectly forced me (as every student who participate in this theatrical commercial show) to spent my money, whilst we have public and free of charges educational system, just to make the money roll from our pockets to others, i have to say that when i see me cut by his grade i will just make a phone call to the ministry of education in Athens and i will just refer everything about him and this full of gangs university of the arse(arse is the ass in Scots hahaha).
and be sure that due to the fact that in Athens right now all the people eat cement (because there is no money and not areas to plant seeds) or they eat each other they will take measures for sure...

so, for all the others who decide to be not out but in and help me

the question is just one why this code does not apply in my stk atmega8515 but apply in atmega324p?
what is the differ between this two micro cpu's? is a program of less than 300 lines code to be demanding in cpu power?
and what is the solution to this specific problem of mine? how am i going to make it run? i could just buy a atmega324p cpu but i dont want to spent money .
i also have to say that here in Greece the this kind of products are too expensive , i asked in a electronic shop and they asked me 20 euros for this cpu its unbelievable !!! they also asked me for the drivers of the electric motors 25 euros !!! (they told me that i need 4 drivers one for each direction)
that is crazy man! all these just because a prof wants to work in Germany and at the same time to pretend that he teach in a university in Greece!! and get paid of course..

so all these people who is really here to help without trying to waste their and my time please just tell me what is wrong with that code and i cant run it in my avr stk500 atmega8515.
the code is made for atmega324p which has more speed than atmega8515 but i think its a little bit weird for a program of less than 300 lines not to be able to run in any micro cpu.

i am waiting for real and specific help !
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jan 28, 2012 - 12:18 AM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21251
Location: Orlando Florida

I guess you could hit the button that says 'export makefile' and post it. That would tell us what files were being compiled and linked. You can compile and then burn the hex file into the 8515 no problem?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jpmargis
PostPosted: Jan 28, 2012 - 02:39 AM
Rookie


Joined: Oct 07, 2010
Posts: 34
Location: San Dimas, CA

In between bites of pizza, I ported the code from http://www.swcoder.co.uk/ over to run on the XMEGA-A1 Xplained. It has eight LEDs and eight switches like the STK500. I get a very nice display of flashing lights. Other than register names, all of the other required changes have been previously discussed.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jan 28, 2012 - 12:23 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62230
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

Cliff... is including <stdlib.h> the only hoop to jump thru to get malloc linked in? No -D or editing of a makefile to include a lib? Is it really that simple? I wonder how swcoder got the delay_ms(ms) to compile?

It really is that simple: Take this:
Code:
#include <stdlib.h>

int main(void) {
  char * p;
  p = (char *)malloc(10);
}

Compile it and run it using any C compiler on this planet and I predict it will work. (and if it doesn't what you are using is not a C compiler).

_________________


Last edited by clawson on Jan 28, 2012 - 03:51 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jan 28, 2012 - 03:17 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21251
Location: Orlando Florida

OK, stavfot... add that include file to your project and recompile. I guess swcoder was using an external makefile and he was specifically adding the -l libraries to the the link command to get the libraries he wanted?
Does gcc set the heap to use all the ram from bss to stack? No way to specify a heapsize? Just include stdlib and all ram not in bss or stack is heap?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
stavfot
PostPosted: Jan 29, 2012 - 02:38 PM
Wannabe


Joined: Dec 15, 2011
Posts: 93


Mr jpmargis(ro else the rat or else the informer or else the canary, or the stool..) tell me while you are eating your pizza, it was so satisfying for you to what you did with not any reason at all? do you know me?...

never mind.

Mr bobgardner i have already #include<stdlib.h> in the project. i really suspect that this problem finally has to do with the cpu specs for it would not be possible to compile and download the code with no errors and warnings at all if it was a programming problem. of course it might be a logical problem and not a syntax error but as far as i checked the code it seems to be ok. that is why i asked this question to this forum, to get a help and solve the problem by taking your advises.
 
 View user's profile Send private message  
Reply with quote Back to top
jpmargis
PostPosted: Jan 29, 2012 - 03:36 PM
Rookie


Joined: Oct 07, 2010
Posts: 34
Location: San Dimas, CA

stavfot wrote:
Quote:

but as far as i checked the code it seems to be ok.


This is exactly my point! As was suggested above, export your makefile and post it here. Or nevermind. Your choice.

_________________
Mr. Informer
 
 View user's profile Send private message  
Reply with quote Back to top
stavfot
PostPosted: Jan 30, 2012 - 09:43 AM
Wannabe


Joined: Dec 15, 2011
Posts: 93


thats the make file :

###############################################################################
# Makefile for the project mounaki2avr
###############################################################################

## General Flags
PROJECT = mounaki2avr
MCU = atmega324p
TARGET = mounaki2avr.elf
CC = avr-gcc

CPP = avr-g++

## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS += -Wl,-Map=mounaki2avr.map


## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature

HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings


## Objects that must be built in order to link
OBJECTS = mounaki2avr.o

## Objects explicitly added by the user
LINKONLYOBJECTS =

## Build
all: $(TARGET) mounaki2avr.hex mounaki2avr.eep mounaki2avr.lss size

## Compile
mounaki2avr.o: ../mounaki2avr.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<

##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)

%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@

%.eep: $(TARGET)
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0

%.lss: $(TARGET)
avr-objdump -h -S $< > $@

size: ${TARGET}
@echo
@avr-size -C --mcu=${MCU} ${TARGET}

## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) mounaki2avr.elf dep/* mounaki2avr.hex mounaki2avr.eep mounaki2avr.lss mounaki2avr.map


## Other dependencies
-include $(shell mkdir dep 2>NUL) $(wildcard dep/*)
 
 View user's profile Send private message  
Reply with quote Back to top
stavfot
PostPosted: Jan 30, 2012 - 09:46 AM
Wannabe


Joined: Dec 15, 2011
Posts: 93


does anybody know were should i plug as inputs the photo resistors ?in any port defined as input? or in a specific port that allows analog values to become digital? (analog to digital)?
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Jan 30, 2012 - 12:12 PM
Raving lunatic


Joined: May 02, 2007
Posts: 3007
Location: Nieuwegein, Netherlands

item 1: that is totaly up to you and how you defined the pins that you want to use. Defining a port setup is done using the PORT, DDR and PIN register. Check the datasheet on how to use them as specially the PORT register has a double function.

by default (after a HW reset) all pins are defined as input without pull-up. Again it is up to you to define them using the above registers.

I would suggest you first try to full yunder stand how to use the PORT, DDR and PIN registers, before starting to use the ADC converter.

As you are already experienced in C you should be able to use the LEDs on the STK500 (IIRC you use that for development) pretty quickly given the above info.
First try to make a LED be ON and then OFF. If you managed that make it toggle with a certain speed. You then can use this code as a simple debug interface.
Then you can advance and start reading the tutorials that are written on the use of the ADC converter in both single and multi channel mode. see my signature for clicking right through to the tutorials forum on that part.

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits