Need help with error analysis on AVRcam hardware!

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

Need help with error analysis on AVRcam hardware!

Postby nobody » Wed Jan 17, 2007 4:23 am

Hi,
This week I tried to get my AVRcam to work but unfortunately it didn't do it as I expected.
We'll the voltage regulator is working (green LED is lit up) and both controllers have their 5V at Vcc. Also there is no short circuit (which I didn't expect from a professionally manufactured PCB).

Fortunately I have another board to program ATmega8 controllers so I tried to take a new mega8 and put the AVRcam firmware on it.
This also didn't work. After some research i discovered the AVR doesn't seem to get a clock signal so I reprogrammed it to run from the internal RC (with 8MHz).

We'll this time it did work! The yellow LED was blinking 4 times (although it was quite slow because of the slower clock) and then stayed powered on.

So I tried to send some signals to the camera with HyperTerminal (with Jumper 2 inserted) but didn't get any response to the "PG" command (also tried with AVRcamView, didn't work too).

I used an oscilloscope to view the signals I was receiving. I did backtrack it (starting at the RXIN pin of the MAX232) to the RX-Pin(2) at the AVRcam, where I saw a correct signal.
Well, since I was running the mega8 at 8MHz I didn't get any signal at the TX-Pin(3).

So the MAX232 seems to work correctly. This means the MAX232 and the ATmega8 can't be the reason (since the LED blinking is done by the mega8)


This lead to the asumption that either the tiny12 or the C3088 camera module are not working correctly!
Now comes the part where I really need help since I still don't understand the exact function of the tiny12 (already read every thread about its purpose) and also don't have a real datasheet for the camera module (exept this one page sheet where I have the pin layout...)

What is Jumper 1 for and what is if I take it out?
The manual ONLY mentions it on page 12 as "AVRmega8 ISP Jumper" but on the page about programming the AVRcam it isn't mentioned.

Well, if I put it in the XTAL1-Pin of the mega8 is connected to FODD of the camera module. Since the XTAL1-pin is for clock input i assumed the mega8 get it's clock from there but the FODD pin of the camera module doesn't output any periodical signal! When I measure it with the osci I only get a constant 5V signal! (don't know what the Odd Field Flag is for, but since its a flag I suppose its normal that its a constant signal but why is it then connected to XTAL1?!)
And also I didn't understand if this would really be for the mega8 clock, why should you wan't to be able to disrupt the connection? Then the mega8 wouldn't have any clock.


So the next target was the tiny12. The only Pin I measured something interesting with the osci was Pin 6 (which goes to the I²C serial clock input) where I got a periodical signal which had a quite high offset in the voltage axis so the low amplitude didn't even reach zero.
That's all I can tell you now (as far as I can remember).



So concluding I can say:

- supply is working correctly (MAX232, mega8 and tiny12 have 5V at Vcc)
- MAX232 seems to work correctly, since I get correct signals at input and output up to the RX-Pin of the mega8
- mega8 is working when I set it to work with 8MHz internal clock (at least it gets the yellow LED to blink)



My questions are:

- what does the FODD pin on the C3088 do?
- why is it connected to XTAL1 of the mega8?
- why can you disrupt this connection with the Jumper 1?
- if the FODD output is supposed to output constant 5V, where does the mega8 get its clock from?
- what am I supposed to measure at the 3 Pins of the tiny12 (5, 6) that are connected to the C3088?
- What are the fuse setting supposed to be? (I read them from the original controller and they where set to "running from external quarzt with 14-16MHz)


Well, I think thats verything for now :P
I hope to get an answer soon because I need to have it running at least in the next month!


PS.: just remembered that I also couldn't reprogram the mega8 in the AVRcam board. When I tried to verify the program there where always errors at some points in the data and when I tried to program it just didn't work. I used avrdude or AVR8 Burn-O-Mat. I did initialise it while the yellow LED was blinking and tried it with JMP1 in and out several times..
Last edited by nobody on Wed Jan 17, 2007 12:16 pm, edited 1 time in total.
nobody
 
Posts: 10
Joined: Fri Sep 08, 2006 11:16 am
Location: Vienna/Austria

Postby nobody » Wed Jan 17, 2007 12:08 pm

Ha! I think I just figured it out myself. I must have been stupid to not see that.

Now I just have to find out if its the camera module or the tiny12 that is not working.
Since I measured a clock signal at the I²C clock input I just fear the worst ... the C3088 is defect!

The only thing I can now hope that the clock signal created by the tiny12 is somewhat wrong, because it looked quite wierd. Unfortunately I didn't take a photo of the signal but I can post a photo of it in 2 days.

Heres a little drawing of the signal I measured:
Image
nobody
 
Posts: 10
Joined: Fri Sep 08, 2006 11:16 am
Location: Vienna/Austria

Postby johno » Wed Jan 17, 2007 9:43 pm

Hi Chirstopher,
My comments are interleaved...

> Hi,
> This week I tried to get my AVRcam to work but unfortunately it didn't do
> it as I expected.
> We'll the voltage regulator is working (green LED is lit up) and both
> controllers have their 5V at Vcc. Also there is no short circuit (which I
> didn't expect from a professionally manufactured PCB).
>
> Fortunately I have another board to program ATmega8 controllers so I tried
> to take a new mega8 and put the AVRcam firmware on it.
> This also didn't work. After some research i discovered the AVR doesn't
> seem to get a clock signal so I reprogrammed it to run from the internal RC
> (with 8MHz).
>
> We'll this time it did work! The yellow LED was blinking 4 times (although
> it was quite slow because of the slower clock) and then stayed powered on.
Good first step...so the mega8 is properly programmed, but as you noted, it is
using an 8 MHz oscillator (internal) now instead of the 17.7 MHz signal that
it typically gets from the camera.
>
> So I tried to send some signals to the camera with HyperTerminal (with
> Jumper 2 inserted) but didn't get any response to the "PG" command (also
> tried with AVRcamView, didn't work too).
...And it shouldn't with the 8 MHz oscillator, since all the baud rate
calculations are for 17.7 MHz.
>
> I used an oscilloscope to view the signals I was receiving. I did backtrack
> it (starting at the RXIN pin of the MAX232) to the RX-Pin(2) at the AVRcam,
> where I saw a correct signal.
> Well, since I was running the mega8 at 8MHz I didn't get any signal at the
> TX-Pin(3).
>
> So the MAX232 seems to work correctly. This means the MAX232 and the
> ATmega8 can't be the reason (since the LED blinking is done by the mega8)
>
Yes, at this point everything with the mega8 and the max232 sounds functional.
>
> This lead to the asumption that either the tiny12 or the C3088 camera
> module are not working correctly!
> Now comes the part where I really need help since I still don't understand
> the exact function of the tiny12 (already read every thread about its
> purpose) and also don't have a real datasheet for the camera module (exept
> this one page sheet where I have the pin layout...)
>
> What is Jumper 1 for and what is if I take it out?
> The manual ONLY mentions it on page 12 as "AVRmega8 ISP Jumper" but on the
> page about programming the AVRcam it isn't mentioned.
Ok...here is what happens when the system powers up:

1) the tiny12 holds the mega8 in reset, and while it is doing this, sends a
couple of I2C commands to the camera to force it to output its internal 17.7
MHz clock on its FODD line (this line is dual purpose...it can be used for
either outputting a clock signal or for generating a pulse on every odd
frame). This clock will serve as the oscillator for the mega8, thus
synchronizing both the camera and the mega8.

2) Once this clock is actively being output by the camera, the tiny12
de-asserts the reset line on the mega8, allowing it to power up. The tiny12
then just sits in an infinite loop doing nothing else.

3) Since the 17.7 MHz clock signal is now available to the mega8, it proceeds
powering up and blinking its LED etc.
>
> Well, if I put it in the XTAL1-Pin of the mega8 is connected to FODD of the
> camera module. Since the XTAL1-pin is for clock input i assumed the mega8
> get it's clock from there but the FODD pin of the camera module doesn't
> output any periodical signal! When I measure it with the osci I only get a
> constant 5V signal! (don't know what the Odd Field Flag is for, but since
> its a flag I suppose its normal that its a constant signal but why is it
> then connected to XTAL1?!)
So this is where things aren't right. It sounds like the camera simply isn't
outputting its clock, which could be due to three things: 1) the tiny12
didn't properly get its I2C commands sent to the camera, and thus there is no
clock signal, or 2) the camera module received the appropriate commands from
the tiny12, but the FODD line is shorted to Vcc (and thus the constant 5V),
or 3) the camera module is not functioning properly. Can you check to see if
the SDA/SCL lines on the camera are toggling at power up? You should see two
I2C commands coming over these lines, which will simply look like the line
toggling a few times if you check them out with an oscilloscope. Be sure to
measure the signal at both the output of the tiny12 as well as the input of
the camera module to make sure it is arrive properly.

> And also I didn't understand if this would really be for the mega8 clock,
> why should you wan't to be able to disrupt the connection? Then the mega8
> wouldn't have any clock.
Originally, when I designed the board, I hadn't figured out a way to
re-program the mega8 in circuit with the camera attached to the system (the
cameras interface to the mega8 re-uses some of the lines needed for
programming). So, I was originally thinking that I would have to pull that
jumper to re-program. However, I ended up figuring out a solution whereby
the mega8 could be re-programmed without doing anything extra, but only in
the first four seconds after power-up (and thus the four seconds of blinking
LED).
>
>
> So the next target was the tiny12. The only Pin I measured something
> interesting with the osci was Pin 6 (which goes to the I²C serial clock
> input) where I got a signal with about 50nanoseconds periodlenght (which is
> about the 17MHz that I thought should be the clock for the mega8) which had
> a quite high offset in the amplitude axis so the low amplitude didn't even
> reach zero.
> That's all I can tell you now (as far as I can remember).
Re-test these lines...you should see activity on both the clock AND data lines
going from the tiny12 to the camera. The tiny12 runs off of its internal
oscillator, which is running at ~1 MHz, so you shouldn't see any pulses that
are purposefully 50 nS (other than glitches). If you don't see the clock and
data lines toggling, probe around a bit to ensure there aren't any shorted
lines or solder bridges. If needed, I can send you the binary that goes in
the tiny12 to try and re-program it with your programmer (the source code is
downloadable as well on the Download section of the JROBOT site).
>
>
>
> So concluding I can say:
>
> - supply is working correctly (MAX232, mega8 and tiny12 have 5V at Vcc)
> - MAX232 seems to work correctly, since I get correct signals at input and
> output up to the RX-Pin of the mega8
> - mega8 is working when I set it to work with 8MHz internal clock (at least
> it gets the yellow LED to blink)
>
>
> My questions are:
>
> - what does the FODD pin on the C3088 do?
> - why is it connected to XTAL1 of the mega8?
> - why can you disrupt this connection with the Jumper 1?
> - if the FODD output is supposed to output constant 5V, where does the
> mega8 get its clock from?
> - what am I supposed to measure at the 3 Pins of the tiny12 (5, 6) that are
> connected to the C3088?
> - What are the fuse setting supposed to be? (I read them from the original
> controller and they where set to "running from external quarzt with
> 14-16MHz)
The fuse settings should have only the CKOPT bit asserted (if you're using
PonyProg, only this fuse will have a checkmark next to it).
>
> Well, I think thats verything for now
> I hope to get an answer soon because I need to have it running at least in
> the next month!
I'm sure we'll get it figured out. I'm actually off of work (my "normal" job)
for the next few days, so I should be able to respond to emails fairly
quickly. Keep me posted...
>
>
> PS.: just remembered that I also couldn't reprogram the mega8 in the AVRcam
> board. When I tried to verify the program there where always errors at some
> points in the data and when I tried to program it just didn't work. I used
> avrdude or AVR8 Burn-O-Mat. I did initialise it while the yellow LED was
> blinking and tried it with JMP1 in and out several times..
This sounds more and more like something is screwy with the tiny12 or the
circuitry around it, which should be easy to fix, especially if you have an
AVR programmer.
-John O
Site Admin
johno
 
Posts: 51
Joined: Thu Mar 16, 2006 2:29 pm

Postby nobody » Thu Jan 18, 2007 1:27 am

Thank you for this detailed descriptions.
Tomorrow I will try to measure the signals at SDA and SCL.
I will also check the Reset line on the mega8 and the signal that controls the transistor.

The fuse settings should have only the CKOPT bit asserted (if you're using
PonyProg, only this fuse will have a checkmark next to it).


I'm using AVR8 Burn-O-Mat (nice and simple UI especially for programming fuses) and the avrdude-gui app from WinAVR (latter somehow had problems programming the fuses)
nobody
 
Posts: 10
Joined: Fri Sep 08, 2006 11:16 am
Location: Vienna/Austria

Postby nobody » Fri Jan 19, 2007 9:20 am

Ha, its working! The problem was a broken circuit path between JPM1 and the XTAL1 Pin!
I'll post a picture as soon as I am home.
nobody
 
Posts: 10
Joined: Fri Sep 08, 2006 11:16 am
Location: Vienna/Austria

Postby johno » Fri Jan 19, 2007 9:24 am

Great! Glad to hear all is well :-)
-John O
Site Admin
johno
 
Posts: 51
Joined: Thu Mar 16, 2006 2:29 pm

Postby nobody » Fri Jan 19, 2007 11:05 am

Here you can clearly see what the problem was ;)
Image
I didn't expect such a long gap in a circuit path on a professionally produced PCB, but at least it works now!

Heres a photo of us beeing happy that the camera works ;)
Image
nobody
 
Posts: 10
Joined: Fri Sep 08, 2006 11:16 am
Location: Vienna/Austria

Postby johno » Fri Jan 19, 2007 3:30 pm

Wow...I don't think I've seen a PCB have a broken trace like that before. My apologies for not catching it before I sent it out to you...I'm glad to hear things are working.

Let me know if any other questions arise.
-John O
Site Admin
johno
 
Posts: 51
Joined: Thu Mar 16, 2006 2:29 pm


Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 15 guests

cron