Espritmodel.com Telemetry Radio
Reply
Thread Tools
Old Feb 14, 2013, 10:49 AM
Registered User
France, Alsace, Strasbourg
Joined Dec 2012
77 Posts
Quote:
Originally Posted by midelic View Post
I think is a confusion.I'm talking about TX not Rx .In Rx eeprom is needed to store previous bind ID otherwise you'll have to bind every time you use you radio.And the frequency and control reg. table are in flash memory.
In your tx code I see no data stored in eeprom.I see only the eeprom read write subroutines and variable declarations....nothing else.I think is from RX code.
Yes, I forgot to remove "eeprom read/write" procedures in TX version.
btw, I have updated both tx and rx code (now takes into account TX ID0 > 0x0F)
ThierryRC is offline Find More Posts by ThierryRC
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 14, 2013, 11:46 AM
RC beginner
New York
Joined Oct 2008
5,914 Posts
Quote:
Originally Posted by midelic View Post
With my limited understanding of asm directives "equ" is used for labeling constants not variables.Is not better use "byte" directive reserving one byte in Sram for a variable?
not quite true because equ can be used to label ram addresses which is the same thing as a variable. define can also be used to label ram addresses but its slightly more suited to renaming registers. something you apparently like to do but i find useless and confusing. ie your program would be half as big w/o those. i do like to know exactly what registers are being used where.

i use equ all the time for constants AND variables but never use define or byte for reasons of portabilty. many of the other mcu families i work with dont support one or both so...
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 14, 2013, 12:03 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,466 Posts
Thierry ,
You said you test the binding part program first.Where this binding part program stopped and can be used for testing.....before "init table read channel sequence"........ or after?
I need to test a minimal working code to see if it's working, binding, before continuing with other.......Any advise?
I see from your code you initialized the ID and servo timing to middle stick 1500 us and.....sent all as the binding packet for 2.5 seconds.After sending this packet ........binding with the Rx is completed.........LED on RX solid red.?I want to separate the code for testing purposes and debugging.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 07:37 AM.
Reply With Quote
Old Feb 15, 2013, 03:56 PM
Registered User
France, Alsace, Strasbourg
Joined Dec 2012
77 Posts
yes, binding stops after calling "bind_RX" procedure.
i think RX behavior depends of brand.
mini quad led blinks at about 10hz when it tries to bind for a few seconds.
As soon as you start tx, if your code is ok, blinking will stop, then you'll know it works!
For binding phase I think that servo timing is not important.
ThierryRC is offline Find More Posts by ThierryRC
Reply With Quote
Old Feb 15, 2013, 03:59 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,466 Posts
So for binding phase is enough to send the TX ID and some dummy data afterwards(zeros).or nothing, only the ID....?
Like you said the Tx quad(I;m trying on quad rx) binding phase is 10 Hz fast blinking and after Tx starting LED stopped blinking on solid red.This I want to achieve first....LED stop blinking.It will easier for me to debug if I run the code till binding phase before loading the channels sequence table.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 04:06 PM.
Reply With Quote
Old Feb 15, 2013, 04:08 PM
Registered User
France, Alsace, Strasbourg
Joined Dec 2012
77 Posts
you need to have 21 bytes payload per packet, no more, no less
so "dummy data" after id would be ok
even a random id should work but first byte of payload must be 0xAA
ThierryRC is offline Find More Posts by ThierryRC
Reply With Quote
Old Feb 15, 2013, 04:16 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,466 Posts
Thanks! Man you are most helpful.
It appears I have problem with atmega 8.I uploaded now a simple program like Dave recommended ....blinking a simple LED...it appears is not working even with this small program ...I have to check where is the problem.
midelic is online now Find More Posts by midelic
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Feb 15, 2013, 04:37 PM
RC beginner
New York
Joined Oct 2008
5,914 Posts
what does avrdude say? are you using the right pin and led polarity? did you change any fuses (BAD idea)?
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 04:41 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,466 Posts
avrdude says ok complete, no errors,,,every time ok.Of course I need to change fuses.I have to set the frequency and internal osc.Factory default is 1 mhz.What means right pin?Led polarity doesn't matter in a blinking cycle.Anyway I checked directly on the battery.Maybe I need to go with fuses on factory default and check again,Maybe program the PB5 like you said.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 04:47 PM.
Reply With Quote
Old Feb 15, 2013, 05:13 PM
RC beginner
New York
Joined Oct 2008
5,914 Posts
personally i would not recommend touching the fuses until the chip is working. bad fuse is the #1 reason noobs (and experts like me) brick the chip. 99% of the time thats the fatal blow and only 1% due to overvoltage or physical damage. but we know yours is fine otherwise avrdude would fail.

your blink program runs ok on my 8mhz and factory 1mhz settings. a slower rate would allow checking with a meter. better yet ldi r23,0xff + out portb,r23 (2 byte program). there will be less chance of a mistake because ALL portb pins go high. 3v with a meter or dim led wired to ground.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 06:12 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,466 Posts
actually avr studio (portb note defined)shows error on this code.I have to include the m8def.inc
I reset also the fuses to factory.

Update:Tested your code with the LED to the ground and checked with meter also,....... it is not working.No voltage at all on all pinb pins
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 06:37 PM.
Reply With Quote
Old Feb 15, 2013, 06:49 PM
RC beginner
New York
Joined Oct 2008
5,914 Posts
lol! this reminds my of the first time i tried to program avr. one thing is for sure, its going to be something silly. counting pins wrong, bad meter, led was not bright enough, missed errors in avrdude, reset stuck low, etc.

i just programmed the 2 word into a fresh m8 and my meter reads 3.45v on all portb pins. its been couple years since i used avr studio. only 3 programs now: edit.exe, avrasm.exe, avrdude.exe (+conf). you might want to post your hex and show the 'dude output. maybe a pic of your setup too.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 07:04 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,466 Posts
See the hex from your blinking code.I'm using usbasp programmer.Only error in avrdude was at the beginning ...."cannot set sck period ..update usbasp firmware"....but this is very common error.My batery voltage is 3.2volts.My setup is very,very,very ugly with,,,,so it is not possible for display.The chip is Atmega8a TQFP with default fuses atm.
But programming closed with avrdude done
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 07:19 PM.
Reply With Quote
Old Feb 15, 2013, 07:24 PM
RC beginner
New York
Joined Oct 2008
5,914 Posts
i didnt check the bytes but just flashed your file with usbasp and all portb bits read hi. i also checked fuses which were c0a4 (8mhz eesave) for the chip attached to the usbasp. almost all mine are set for that. like i said this is going to be a riot when we finally find your problem.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 07:34 PM
RC beginner
New York
Joined Oct 2008
5,914 Posts
Quote:
Originally Posted by midelic View Post
But programming closed with avrdude done
"set sck.." is normal and to be ignored and factory fuse are ok. but "done" does not tell you avrdude programmed ok. the entire output message must be read. im not sure how much as6 hides but suggest trying from the command line. even if verbose is not turned on all errors are displayed.

ps you are very brave to start with smd. and note that mega8a is a different chip (different process) than mega8 but should be 100% compatible. ive never used one.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question 9X - FlySky/iMax/Turnigy/Eurgle FOR DUMMIES aeajr Radios 984 Jun 08, 2014 01:51 AM
Discussion Benefits of buying FlySky TH9x (v2) over Turnigy 9x (v2) wwfisher Radios 43 Apr 28, 2014 06:25 PM
Found turnigy 9x/flysky 9x wanted!!! kremecheze Aircraft - General - Radio Equipment (FS/W) 2 Mar 25, 2012 04:04 PM
Wanted ER9x or Turnigy/Flysky 9x daign FPV Equipment (FS/W) 0 Mar 22, 2012 06:21 PM
Found Turnigy/FlySky/Eurkle/etc 9X Shell flyandi Aircraft - General - Radio Equipment (FS/W) 0 Mar 11, 2012 06:12 PM