I2C Clock issue on HCs08

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C Clock issue on HCs08

1,070 Views
prajaktakakade
Contributor I

I am doing I2C bit banging with HCs08 as a master and external accelerometer as a slave.

As internal crystal is of 4 Mhz. We want clock cycle of 100 MHz

Aim- To generate 5usec ON and 5usec OFF clock cycle on SCL pin.

Observations and Problems-

  1. Calling timer routine from main (see 1.1.).
  2. Timer for 5usec is configured (1.2.).
  3. Enable interrupt and start timer by giving clock (1.2.).
  4. Checked whether timer overflow flag (TOF) set, TOF value is 1, But ISR routine is not executed (1.3.).\

Code is attached.
Please tell me anyone.
where i m going wrong?

0 Kudos
Reply
4 Replies

900 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi

I got lost, your problem is with the timer? or with the IIC module?

regards

Vicente Gomez

0 Kudos
Reply

900 Views
prajaktakakade
Contributor I

HCs08 doesn't have in-built IIC module. SO need to do iic bit banging.
Problem is with clock generating for IIC.

0 Kudos
Reply

900 Views
vicentegomez
NXP TechSupport
NXP TechSupport

What part are you using?

I b elieve that all the HCS08 device has a IIC module on in, I do not remember if the smallest one does not have it, but for intace the S08SH has it.

Thanks

0 Kudos
Reply

900 Views
prajaktakakade
Contributor I

Part no. is FXTH871x7

0 Kudos
Reply