HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Feb 15, 2013, 10:51 AM
RC beginner
New York
Joined Oct 2008
5,959 Posts
you can see if power supply is damaged or not.
you can tell if the time you plugged the chip in backwards killed it or not.
you can see if crystal is working or not.
you can tell if the xtl is connected to the right pins or not.
you can tell if fuses are burned correctly or not (i could list a dozen separately but lets not waste space)..
you can tell if farnell/digikey sold you a good chip or not.
you can tell if wires are soldered right or not.
you can tell if the circuit board was damaged by asteroid exploding in the sky above.
you can tell if the led is good or not,
you can tell if the 1k resistor in series is good or not,
you can tell if you connected the led properly or backwards.
you can tell if the download software is working or not.
you can tell if the download hardware (ie usbasp or 4 wires to parallel port for me) is ok.
you can tell if the reset circuit is designed correct.
you can tell if your assembler or compiler are working right.
you can tell whether you know how to write avr code or not.
and at least 400 other things related to JUST the avr chip itself.

beyond that with actual projects like this:
you can tell if the unexpectedly cheap a7105 modules you got from china are any good or rejects.
you can tell if the a7105 connections to the mcu are right.
you can tell if the modifications you made to the a7105 xtl was done right.
you can tell if the the a7105 survived being stepped on by your wife.
you can tell if the bitbang spi routine you cooked up because the avr hardware one is crummy works.
you can tell if the init routines you copied from fracturedblue are correct.
you can tell if the a7105 calibration routines are returning the right values.
you can tell if the a7105 is sending packets using the routines you translated from c to asm work.
you can tell if the a7105 is receiving properly with the homebrew routines you wrote from scratch because there were none to copy.
you can tell if the binding sequence based on rcgroups threads is any good.
you can tell if the rcgroups hopping algorithm is hitting all channels or missing some.
you can....

well... i think you get the picture. at least a million possible things can go wrong in a project like this and the lowly led is your best friend. a scope can be used to detect most of these problems but it costs one hundred thousand times more, is big and clunky, and in some cases cannot show the problem. like missing channels which looked ok on my screen but the blinky routine told a different story.
dave1993 is offline Find More Posts by dave1993
Last edited by dave1993; Feb 15, 2013 at 04:32 PM. Reason: dont forget the scope
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 15, 2013, 11:38 AM
We can rebuild it!
djdavies83's Avatar
United Kingdom, Wales, Swffryd
Joined Apr 2010
3,631 Posts
Dave, 4 wires to parallel port?

Is that a way to program without a USBASP?

My USBASP is currently AWOL so if I can program with just a plug and a few wires that's sweet!
djdavies83 is offline Find More Posts by djdavies83
Reply With Quote
Old Feb 15, 2013, 11:50 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,492 Posts
And where I have to connect the LED to get these marvelous things diagnosed.On SDIO and GIO pins of A7105?And how is done? ..dou you insert a blinking routine after each important code? For example after calibration complete go to blinking led?Or after sending ID code go to...... blinking led ?I'm really interested in the method for diagnose.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 11:56 AM.
Reply With Quote
Old Feb 15, 2013, 11:51 AM
RC beginner
New York
Joined Oct 2008
5,959 Posts
Quote:
Originally Posted by djdavies83 View Post
Dave, 4 wires to parallel port?
yes. best kept secret. avrdude supports the so called lpt programmer which is literally nothing more than 4 wires and has exactly the same functionality of the expensive flash dongles. in fact i use a custom flash util that only needs 3 wires: mosi, sck, and res. most people dont realize you only need 3 wires to program an avr.

best of all it costs 1/100th as much as usbasp. 1/1,000ths as much as mkII. dragon... well... you get the picture. i got many of them scattered around the house because i keep losing them under a piece of paper or whatever.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 01:22 PM
We can rebuild it!
djdavies83's Avatar
United Kingdom, Wales, Swffryd
Joined Apr 2010
3,631 Posts
So this method is the end of the chicken an the egg debate over USBASP, and that you can make a USBASP but you need something to program that AVR with, this is that something.

I'm gonna have to read up on how this works.
djdavies83 is offline Find More Posts by djdavies83
Reply With Quote
Old Feb 15, 2013, 04:18 PM
RC beginner
New York
Joined Oct 2008
5,959 Posts
Quote:
Originally Posted by midelic View Post
And where I have to connect the LED to get these marvelous things diagnosed.
pb5 is the popular standard for a couple reasons: first its the sck signal for isp programming and will not interfere there so wont risk dragging app signals down (or up) elsewhere. second its what all the arduino boards use and that is the most common mcu platform on earth. all the blinky demos expect it to be there.

no point in attaching an led to the rf chip. thats where a scope probe goes. the key to implementing all those diagnostics i listed above is mcu code. thats where 99.9% of the functionality of any system resides. specially regarding diagnostic tools.

btw did your chips come in? i was impressed by your ability to code even the simple blinky w/o a chip. however i think you need to print hello or at least a hex number in order to succeed in any project. this would be virtually impossible to develop w/o a running avr. id be curious to see what you come up with if you do decide to go there.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 04:53 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,492 Posts
I already wired the M8(dead bug style)and programmed it.I prepared also a red LED setup with a 68 ohms for 3.2 volts.Now I need to see why is not working.
Still I don't get it how with a blinking LED you can do all those diagnostics.All programming timings are so small(nanosec or microsec.) that an LED cannot catch....only a long light time period or nothing at all.
Thanks for the tip on PB5.
The blinking LED is very easy.I'm amazed you can be so enthusiastic with such a simple program.Can you define the theme for print hello or hex? ,,,I saw so many variations on the net.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 05:01 PM.
Reply With Quote
Old Feb 15, 2013, 05:30 PM
RC beginner
New York
Joined Oct 2008
5,959 Posts
i think you might be starting to appreciate the importance of blinky right about now. and look at what those other jokers came up with and they HAD (or pretended to) chips. BOTH pretenders submitted non-functional blinky code. i might be more experienced but you are definitely smarter than me and the other guys.

again you are not attaching the led to hardware to see nanosecond pulses. ie the mcu does something, reads a bit, writes and checks a reg, etc and if the result is as expected turns on or blinks the led. remember to hang after that or there will be no useful info.

it may be possible to debug a program as complicated as yours with a led, specially if you are just copying thierry, but reading regs is usually the first step for a competent coder. you could write and check then do the led but its more useful to have the mcu send out a hex value to read with hyperterm or whatever.

i like software (bitbang) serial because theres many advantages over hardware uarts. but as usual this is not popular with mainstream "experts". as they laugh and go back to pecking away in their ide im handing over to my client and grabbing the check.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 15, 2013, 06:02 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,492 Posts
Yes I'm starting to see that.Believe me I'm not laughing at all.As I told you before i like asm because it keeps you connected with the hardware.In fact I'm amazed you can do so much things with a simple LED.So as I presumed ....you insert a small blinking LED snippet at the end of some important code ....
I appreciate your effort in helping me.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 15, 2013 at 06:08 PM.
Reply With Quote
Old Feb 17, 2013, 03:40 AM
romantist
palomo's Avatar
Chicago
Joined Jul 2004
1,059 Posts
Dave1993,
Congrats on this development! I'm totally SUBSCRIBED!!!! I will be catching up on this thread soon and hopefully will see some great possibilities adding one of these rx's with my tiny helicopter creature.

djdavies83, thanks again for the find......
palomo is offline Find More Posts by palomo
Reply With Quote
Old Feb 17, 2013, 03:54 AM
We can rebuild it!
djdavies83's Avatar
United Kingdom, Wales, Swffryd
Joined Apr 2010
3,631 Posts
Quote:
Originally Posted by palomo View Post

djdavies83, thanks again for the find......
No worries, making links between thinkgs is what I do. looking forward to your subgram-heli!
djdavies83 is offline Find More Posts by djdavies83
Reply With Quote
Old Feb 17, 2013, 07:48 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,492 Posts
Dave,
Once you enable the PI you don't have control of the Pb5(sck pin).The one you can toggle is SS pin.I inserted the blinking routine till to the end of program to check if the program hangs somewhere but no problem LED is blinking....but no binding.
midelic is online now Find More Posts by midelic
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Feb 18, 2013, 05:54 AM
RC beginner
New York
Joined Oct 2008
5,959 Posts
im not sure what "PI" is but my led has never interfered with any of the apps including spi. maybe use 1k series resistor like me instead of your 68 ohm. i find that even at 3v a 10k is more than bright enough for modern day leds. specially the cheapo one cent ebay 0406 smd. unlike 3mm and 5mm they can be seen in direct sunlight.

have you verified that you are actually reading and writing a7105 registers?
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 18, 2013, 06:40 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,492 Posts
Sorry,
I was talking about SPI interface.How can I check that ,......if A7105 reading or writing data?
Anyway I'm rewriting the SPI rutine without the enabling SPI interface.
Avr is 4 wire SPI and my V911 tx module requires 3 wire SPI.Atm my MISO pin is not connected.
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Feb 18, 2013 at 06:51 AM.
Reply With Quote
Old Feb 18, 2013, 07:05 AM
RC beginner
New York
Joined Oct 2008
5,959 Posts
aha... so the answer is no. then not surprising no binding yet. imo you need to learn to walk before you run:

Quote:
Originally Posted by dave1993 View Post
reading regs is usually the first step for a competent coder. you could write and check then do the led but its more useful to have the mcu send out a hex value to read with hyperterm or whatever.
the 3-wire/4-wire thing is not an issue. if you insist on using the hadware spi (bad idea) then a resistor between miso/mosi is required. again bitbang method shows its superiority by requiring no resistor and using fewer pins as a side benefit.

either way you need to get the spi working before even starting to play with protocols or binding. baby steps.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Mini-HowTo TH9X Turnigy FlySky IMax modify module to SMA and 1W booster DIY FPV rotaryboots Radios 3 Jun 08, 2013 02:32 PM
Sold iMAX/Turnigy/FlySky TX module & RX John Kim Aircraft - General - Radio Equipment (FS/W) 0 Jan 12, 2011 12:33 PM
For Sale iMAX/Turnigy/FlySky TX module & RX John Kim Aircraft - General - Radio Equipment (FS/W) 2 Dec 09, 2010 11:15 AM
For Sale Turnigy/iMAX/FlySky TX module & RX John Kim Aircraft - General - Radio Equipment (FS/W) 0 Oct 27, 2010 11:03 AM