I2C and Processor Expert

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

I2C and Processor Expert

Jump to solution
2,685 Views
Royjr
Contributor I

I am relatively new to micro-controllers and having trouble with my first I2C application. I am using a MC9S1C32 processor to communicate with an external capacitance to digital Converter (AD7746). I have the micro correctly hooked up to the data/clock lines of the converter, and the I2C bean added in my project. I am using code warrior 5.5.1272 and processor expert 2.95. In the I2C bean settings, I entered in the slave address 72 which is specified in the AD7746 datasheet. I believe my problems are in the way I am trying to call the functions generated by the I2C bean.

Currently my I2C code is as follows:

EI2C1_SendChar(0x01); //Send x01 over I2C to set sub address register of converter to 1

EI2C1_RecvBlock( 0xC000, 3); //Receive 3 blocks of data from the converter, store starting at address C000

That code then gets repeated every second.

When I look at address C000 with the debugger, the values never change from zero (I have a small capacitor hooked up to the converter capacitance measurement channel). I viewed the data/clock lines with a scope to verify messages where being send, and I was seeing serial like communication.

Also the AD7746 external ready pin never changes when viewed with a scope. So I believe another problem is I never "say go".

Anyone have any help, pointers?

Thanks.

Labels (1)
Tags (1)
0 Kudos
1 Solution
357 Views
ProcessorExpert
Senior Contributor III

It seems that your problem could be caused by three following misunderstandings:

- the EI2C1_RecvBlock method has 3 parameters, not 2

- 0xC000 is from FLASH memory in default setting and therefore you didn't receive any data

- possible incorrect usage of EI2C_RecvBlock method, this method receives a block of 3 bytes size, not 3 blocks

I hope this help you

Best Regards, Jan Pospisilik, Processor Expert Support

 

View solution in original post

0 Kudos
1 Reply
358 Views
ProcessorExpert
Senior Contributor III

It seems that your problem could be caused by three following misunderstandings:

- the EI2C1_RecvBlock method has 3 parameters, not 2

- 0xC000 is from FLASH memory in default setting and therefore you didn't receive any data

- possible incorrect usage of EI2C_RecvBlock method, this method receives a block of 3 bytes size, not 3 blocks

I hope this help you

Best Regards, Jan Pospisilik, Processor Expert Support

 

0 Kudos