Generate SYS_CLK/20 on a PINA6 of my microcontroller atmega128

Status
Not open for further replies.

kunal5959

Junior Member level 3
Joined
Jul 26, 2011
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,644
I am using LTC1799 IC to generate a sys_clock signal of 1.83200 MHz for my project. In my project i have to use all channels of TIMER 1 and TIMER3 and TIMER0 to generate PWM cycles. Now i need to interface ADC128s102 to my microcontroller. This ADC runs on SPI protocol and my goal is to generate SCK with 20us period for reading the ADC SDOUT. By since all timers are already used as interrupts or PWMs i want to just generate SYS_CLK/20 on a PORTA6 of my microcontroller..

1))avoiding use of TIMER0,TIMER1 and TIMER3 can anyone suggest how to generate a clock that is SYS_CLK/20?

2))Other interrupts and timers being active will it affect this port in anyways, because PORTA6 uses the system clock to generate its clock signal??
 

Is there a reason not use the built in SPI on the Atmega128 (SCK on pin PB1) ?
Also, the ADC128S102 calls for a minimum 8Mhz clock on SCLK. Will a 50KHz clock be a problem?
 

Is there a reason not use the built in SPI on the Atmega128 (SCK on pin PB1) ?
Also, the ADC128S102 calls for a minimum 8Mhz clock on SCLK. Will a 50KHz clock be a problem?

cannot use SPI interface because i am using it as programming interface....
 

There is not enough information given about the project to be able to advise on a good solution.
It seems that an interrupt would be the best way to generate the clock.
For a 20us clock cycle, PA6 would have to be toggled every 10 us. This would correspond to once every 18 system clock cycles, so, there are tight time restraints.
It is not know whether interrupts are being used for any other functions.
The slow system clock places limits on the microprocessor's capabilities.
Timers and USARTs can use external clock inputs other than the system clock, if this is an option.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…