Change something in Win AVR

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Friends 

Hi and good day

I always use CV(codevision) for my project but now , im working an a chip (ADE7758) which i have found a Code in Winavr for it .

the crystal that im using now , is 11.0592 mhz but in this code the crystal is different . since i can't change and compile the project i need someones help to do me a favor and change the crystal to 11.0592 . 

http://www.vabolis.lt/stuff/2012...

by the way can any one help me to change the whole code to CV ?

Kind respects

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I built this with avr-gcc 4.5.3 not the 4.3.3 that is in WinAVR but I guess it should be OK - I got no build warnings/errors.

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much 

i tested the file . but like before , i see only the message "Matuoklis. V2.1. (c)2012 by SAVEL" in my lcd and when i reset the micro i see "watch dog !"message . I thought that the problem must be due to the crystal that i see this message(since the init hardware function cant init the IC) but when i tested your hex file ,i saw again the same output . 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You really need to get your own copy of the compiler so you can keep rebuilding the code. That way you could add some debug to it to see how far it's getting and why it's getting to the point of outputting the messages it does. Just building the code once, putting it in the AVR and then finding "it doesn't work" is not really the way to go about solving something like this.

 

Whether you use Windows or Linux just get the "Atmel Toolchain" and then you can build it too.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Again thanks for the help

I think it will take a long time for a person like me who is not familier with the Avr gcc to work with it . Could you please help me to change the code to CV ?

What i need is to know how I can change the code ( any manual which describes the equivalent libraries and  functions in CV and win avr )

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

syavash_kasraeee wrote:
I think it will take a long time for a person like me who is not familier with the Avr gcc to work with it .

But everything in those files is already set up to build the code?

 

I literally just downloaded the files. Edited the main.c to change the 7.38 to 11.0592. Then I gave the command "make main.hex" and that was all it took. There isn't a lot to it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I changed the crystal to  7.38 and tested the circuit again . i saw the same display but the message "Matuoklis. V2.1. (c)2012 by SAVEL" was sent in serial port over and over . i think that some where in the code something is checked (maybe initializing the eeprom ) and when it cant init it , the watchdog resets the micro over and over . am i right ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

syavash_kasraeee wrote:
am i right ?

I cannot see that - are you misunderstanding what the function wdt_reset() does? It does not cause the CPU to reset. (in fact the opposite - it prevents it from resetting).

 

If you think there is an issue with the watchdog try turning it off (ie don't enable it in the first place) and see what happens.