Jump to content
Sign in to follow this  
jparisse

ATMEL AVR Programming Help

Recommended Posts

Guys,

I'm attempting to burn Thomas Scherrer's modem software onto a pair of ATMEL ATTINY2313 microcontrollers. He asked not to be bothered with questions so I am addressing my questions here instead.

I have experience with BasicStamps so I am somewhat familiar with the process but I need a bit of hand holding to connect the AVRISP programmer to the chip to burn the program onto it. I don’t speak C or Assembly. :(

First Question: Is the SK500 development board (or others like it) necessary for chip burning or can the AVRISP be directly connected to the microcontroller? I ask because the pinout on the AVRISP Programmer seems to match some of the pins on the ATTINT2313 so I just patched it in. It didn’t work (I attempted with the RESET line both high and low). The tutorials only seem to cover the connection to the development boards and the pinout diagram is ambiguous (red stripe is Pin1 but which side of connector? Left or Right?).

I’m pretty sure that what I’m attempting to do is easy, but never having done it before I up against a learning curve wall. If successful with this project, I intend to offer this modem to the general A/P, FPV and UAV communities so we all can use Google Earth Plus as a moving map program (sending $2 a pop to Thomas’ PayPal account.). :D

Thanks!

Jeff Parisse

www.teslacoil.com

310-748-5893 (I’ll return the call if one decides to call to help)

Edited by jparisse

Share this post


Link to post
Share on other sites
Is the SK500 development board (or others like it) necessary for chip burning or can the AVRISP be directly connected to the microcontroller?

The AVRISP can directly connect to the target chip via the ISP interface. Some clones of the AVRISP need external Vcc power to the chip; the authentic AVR USB version does not.

It didn’t work (I attempted with the RESET line both high and low).
That doesn't sound right. The AVRISP handles the chip's reset line.

red stripe is Pin1 but which side of connector? Left or Right?

Pin 1 is identified with an embossed arrow head.

Have you reviewed this?: http://www.atmel.com/dyn/resources/prod_do...RISPmkII_UG.pdf

Share this post


Link to post
Share on other sites

Yes, I studied that document.

On page 24 it seems as if Pin 1 is closest to the viewer (farthest from edge of target board shown).

The PinOut on Page 26 doesn't say if the plug is viewed from the bottom or top (I assumed top and wired as such).

The RESET line description on the same page is unclear (to me). As is the reference to the pull up resistors on the data lines as I just connected those directly (i.e. I jumpered the plug of the AVRISP to the pins on the chip.

I figure I'm very close... ;)

Thanks for your help Tom!

Jeff

p.s. I'm gettin' a Butterfly after this is all done so I can learn more!

Edited by jparisse

Share this post


Link to post
Share on other sites
On page 24 it seems as if Pin 1 is closest to the viewer (farthest from edge of target board shown).

Yes. I can even see the embossed arrow head.

The PinOut on Page 26 doesn't say if the plug is viewed from the bottom or top (I assumed top and wired as such).

It is top view.

The RESET line description on the same page is unclear (to me). As is the reference to the pull up resistors on the data lines as I just connected those directly (i.e. I jumpered the plug of the AVRISP to the pins on the chip.

The Reset signal on the ISP cable goes to the reset pin on the ATMEL chip. A pull-up resistor is needed (normally found on the target board). Since you are trying this with a bare chip, I suggest 10K ohms to Vcc.

Share this post


Link to post
Share on other sites

Tom,

Thanks... I d/l'ed the data sheet and I see now how the reset pin works (no wonder Thomas S. didn't want to answer any questions....). :rolleyes:

I'm set to go and will give it another try tonight. The crystal is mentioned as optional and I remember seeing something in AVRStudio about settting the kHz as a software option. Before I jump in, is there anything I should know about the "option" of a resonator? I reviewed the application notes in case I have to add one.

Jeff :blink:

Share this post


Link to post
Share on other sites
is there anything I should know about the "option" of a resonator?
From what I saw on the schematic, the software modem uses the internal oscillator. An xtal or resonator (poor man's xtal) is not required when the internal oscillator is selected.

Share this post


Link to post
Share on other sites

Right On! That's how it looked to me but I have to check... Thanks for the newbie help!

Jeff

p.s. As a "real" director, I get a big kick out of seeing "Stage Hand" next to my name. I guess in this realm, I AM a Stage Hand! Too much fun! Thanks again!

www.teslacoil.com

Share this post


Link to post
Share on other sites
As a "real" director, I get a big kick out of seeing "Stage Hand" next to my name. I guess in this realm, I AM a Stage Hand!

Before you know it, you will be a gaffer! :)

Share this post


Link to post
Share on other sites

any reports about how the modem is working for you?

well it is not my design or invention,

ok I posted the info and link to one of my pals that made it after my instructions and needs :-)

I did not say I dont want to be bothered, not to this forum that is :-)

Good luck, have fun..

and please repport back to us with your results,

remmeber the invert signal thing !

Share this post


Link to post
Share on other sites

Thomas,

You wrote: "People that construct cool RC planes, with cool video gear,

will be able to make an AVR programmer,

and do this simple hw all by them self, it is unsupportet, and we will not answer questions and we can not help if they can not find out how it should work.

if no skils, ask a dude near your self to program and test it :-)"

I just wanted to be sensitive to your “gift” and not trouble with my newbie questions. Thank you for clarifying you position, I'm sorry I misunderstood. Yes, DZL should be given credit for the code. But he is only three letters to me so he’s somewhat of a mystery man. ;) Thanks for your help!

Modem?

So far so good. I have successfully programmed the TX chip and it seems to work. Digital goes in and tones come out with a signal on top of them.

The RX, however, doesn’t seem to program like the TX did. For example, I can’t write the clock calibration byte as I was able with the TX. When finished programming, the RX accepts the audio in (I directly connected on the breadboard) and outputs a digital signal but the digital pulse widths are much different than the pulses in.

I’m going to patch in an RF link so I’m doing “real world” tests. I’m also going to measure the pulse out signals so I can attempt to troubleshoot the RX. Without source code or a working example, I’m working blind (but that is OK since this isn’t really my project), especially given my skill level with PICs.

I’ll have more information this afternoon once I take some measurements with the RF link in line. Thanks again!!!

Jeff

Edited by jparisse

Share this post


Link to post
Share on other sites

my comments:

make the two bread boards work together before going wireless.

The tx MUST have 4800 baud serial input at the pin assigned as the serial in,

if you only pul the pin hi/low with a switch or what ever it wil not work,

The RX must have right phase signal to work, so try both outputs from the TX until the RX say nice NMEA txt on the output pin, remember you need RS232 converter like MAX232 to be able to connect the data from the RX chip to you PC and see it is working.

The TX chip can be connected directly to RS232 signals from GPS modules like EM406 and other with 3-4-5 volt serial outs.

Actually you dont need a GPS unit to test the modem, you can use a simgle PC with two serial ports, and two terminal windows at the same time, or even the same serial port, to see if you get an echo or not.

Both chips are programmed with 8Mhz internal and no divide clock by 8,

the rest of the fuses dont really care that much for this project,

I prefer to use Brownout enebled to 2.7V or 4.3 depending on what kind of stable supply I have. Be carefull not to select external crystal osc ! else you will crud up your AVR until you input external osc signal. and DONT select Debugwire enable

unless you have a JtagiceMK2 on stock or with the STK500 you can use the parallel programming to erase it again.

the txt about not answering questions was ment as a joke, but ok imagine how many pages I have online on how many topics ?! and then imagine how many people ask me questions every day, I have to delete most of them, else it will be a full time job just to read the mails !

dzl hehe ok try dzl.dk it is that easy to find him.. but he will not answer ! unless he really is having a few minutes of boredom and I find that hard to belive.

Edited by ThomasScherrer

Share this post


Link to post
Share on other sites

Thanks Thomas!

The input is a NMEA 4800baud serial stream from GPS.

I DID miss the /8 fuse and I changed to “disable” (tones are now higher in freq. when TX output is fed to audio amplifier).

TX outputs seem to be on Pins 12 & 13 not 11 & 12 as shown in schematic.

All programming feedback on both chips is positive “OK”

RX output is still zero. I plan on testing other pins and lastly switching chips.

Jeff

Re: Jokes... I get ALL the Tesla coil questions! :D

post-6-1173419575_thumb.jpg

Edited by jparisse

Share this post


Link to post
Share on other sites

Double and triple checked everything... still no digital signal on RX Pin3. The chips are talking to the AVRISP and the TX seems to work fine (nice 5kHz triangle wave) and the modulation lines up with the digital in so I'm going to focus my troubleshooting on the RX side. Not tonight... the pizza and cola late nights are long over (I have kids too).

:rolleyes:

Jeff

Share this post


Link to post
Share on other sites

The first thing I did this morning was to power up my protoboard and scope out all the pins on the RX (I think my electronics addiction is no longer in remission). :o

I noticed that Thomas mentioned breadboardS; as in plural. I am going to separate the working TX onto a different protoboard to isolate the two circuits electrically and see if that helps. It is weird that I got pulse out when my clock was incorrectly set for divide by 8. I tried setting it back just to see: nothing. I have switched ATTINY2313 chips too and I get the same results (I also swapped the capacitors before deciding it was time to go to bed). :blink:

After that, I'm not sure what direction to go. Thomas, as the agent for super spy DZL, perhaps you can ask him (the next time you see him or whenever is good) for any general troubleshooting tips for the RX. If he wants to trade Tesla coil parts for help or source code, I'd gladly help out.

Thanks! Jeff

Share this post


Link to post
Share on other sites

Progress so far:

I separated the project onto two protoboards. I am getting a digital out signal from the RX but it doesn’t resemble the GPS serial data going into the TX. Hooking up a MAX232 seems to clean up the signal but not enough for me, the terminal program or Google Earth Plus to recognize it as a GPS serial. The pulses are very wide.

Observations:

1. I get an error in the message window of AVRStudio 4 that I don’t have the WinAVR tools installed: “gcc plug-in: No WinAVR installation found. The AVR GCC plug-in can still be used if you set up your own build tools.” So far, I have been ignoring this message.

2. I’m going to borrow a dual trace scope this weekend to verify that the signals on TX pin 12 and 13 are indeed inverted.

3. I have set the GPS to send GGA & RMC sentences.

4. Since there was a pinout error on the schematic of the TX, I reason that there MIGHT be a pinout error on the input side of the RX. I’m going to fish around to see if injecting the analog input signal on other pins of the RX makes any difference.

The reason I don’t want to add a Maxstream Xtend onto my UAV is that I don’t want the additional power drain, weight, expense and extra RF signal. I’ll keep on plugging away. Please let me know if you have any thoughts on my observations. Thanks

Jeff

post-6-1173553579_thumb.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×