Re: how to determine the difference between 60 / 50 hz in C
From: Las (e.flag_at_rainbow.net)
Date: 12/29/03
- Next message: Nick: "Re: Good books on firmware"
- Previous message: Robert I. Eachus: "Re: Certified C compilers for safety-critical embedded systems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 28 Dec 2003 20:30:05 -0500
My problem was more elementary than I had first figured. The system crystal
runs at 12MHz divided down to 1.5MHz. From there the prescaler which is set
to 63 (a down counter) gives me a clock value of 42us. With this and a timer
set to 255, the timer will be deincremented each 42us to give me a value of
198 for 60Hz and 238 for 50Hz. The area I was having difficulty
understanding was the value of the clock. 12MHz = .0000000833333333 per
cycle; and this being divided down to the counter value of 42us. After the
light bulb went on, everything else was easier.....thanks everyone for your
help......
- Next message: Nick: "Re: Good books on firmware"
- Previous message: Robert I. Eachus: "Re: Certified C compilers for safety-critical embedded systems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|