Re: [WheelWatcher] AVR ATMega at 8MHz



I made all the changes you described and it works fine.  Thank you very
much!

I was getting my output from port c.2 and port c.5.  They gave no output
even after I changed the code.

With servos connected to port d.4 and port d.5 it works fine.

Thanks again.

TIm

-----Original Message-----
From: wheelwatcher-bounces@xxxxxxxxxxxxxxxxx
[mailto:wheelwatcher-bounces@xxxxxxxxxxxxxxxxx] On Behalf Of Pete Skeggs
Sent: Friday, June 20, 2008 10:48 PM
To: WW-01/WW-02 WheelWatcher Encoder Support List
Subject: Re: [WheelWatcher] AVR ATMega at 8MHz


Tim,

Sorry you're having trouble.  Did you modify the code at all?   Exactly 
which atmega are you using?

The first two lines after the comment header would need to be changed 
depending on which atmega and certainly regarding the 8MHz speed:
|$regfile = "M16def.dat"
$crystal = 8000000 ' was 16000000

|
This would not explain why you would see no output at pins D4 and D5 but 
are seeing valid serial port output.  The only reason that could be is that:
- you changed the code in a bad way
or,
- you're not using an atmega16, but some other spin with slightly 
different internal peripherals
or,
- there is a wiring issue
| |

||

As for other timing changes, timer 1 would be oscillating at fosc/64 = 
125,000 Hz instead of 250,000, so you would need to set Capture1 = 2500 
to get the PWM frequency to be 50Hz as required for servo control 
pulses.  This would then mean that Max_servo should be 250, Min_servo 
125, and Mid_servo 187, which are initialized before Main.

You would also need to change the initialization of Out_r and Out_l in 
Setup to 250 and 125 respectively.

-Pete



||Tim Chapman wrote:
> I am running the code found at 
> http://www.nubotics.com/support/ww01/code/atmel/bascom/ww01_bascomavr_
> monito
> r.bas.php
> I have an ATMega running on the internal oscillator at 8MHz.
> I am getting output showing all the values advancing just fine.
> I am getting no output to the servos.  I checked the signals with my
> oscilloscope on PinD.4 and PinD.5 as well as PinC.2 and PinC.5.  Nothing
> going on there at all.
>
> Will this work at 8MHz or is 16MHz required?
>
> Thank you for your time.
>
> Tim
>
> _______________________________________________
> WheelWatcher mailing list
> WheelWatcher@xxxxxxxxxxxxxxxxx 
> http://list.nubotics.com/mailman/listinfo/wheelwatcher
>
>
>   






This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.