Hello!
I want to use the CAL_I2C component macro with a PIC24FJ256GA702 microcontroller.
In the Properties window, the SCA and SCL pins point to non-existent port.
If I change the I2C channel, the SCA and SCL port pins do not change.
Regards,
Sasi
CAL_I2C Component Macro Connection problem
-
- Posts: 107
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 12:11 pm
- Has thanked: 37 times
- Been thanked: 14 times
-
- Valued Contributor
- Posts: 1518
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 726 times
Re: CAL_I2C Component Macro Connection problem
As a temporary fix:
If you double-click on the property name (e.g. SDA) you should get an 'Edit property' dialog box.
Click on 'writable' and then okay - and the property is now changeable...
Martin
If you double-click on the property name (e.g. SDA) you should get an 'Edit property' dialog box.
Click on 'writable' and then okay - and the property is now changeable...
Martin
Re: CAL_I2C Component Macro Connection problem
Hi Martin,
Thank you very much!
I didn't know about this option.
After setting the port pins I tried the CAL_I2C Macro. I found that the "Transaction_Initialise" command rotates the address value one place to the left. For example, if the address of the I2C device is 0x78, I have to enter 0x3C in the command to make it work properly.
Should I report this in a new bug report?.
Regards,
Sasi
Thank you very much!
I didn't know about this option.
After setting the port pins I tried the CAL_I2C Macro. I found that the "Transaction_Initialise" command rotates the address value one place to the left. For example, if the address of the I2C device is 0x78, I have to enter 0x3C in the command to make it work properly.
Should I report this in a new bug report?.
Regards,
Sasi
-
- Valued Contributor
- Posts: 1518
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 726 times
Re: CAL_I2C Component Macro Connection problem
Hopefully the pins can be marked as changeable in the component.
The address is shifted left one bit when sent - bit 0 is then read/write (1/0). transaction initialise should take the unshifted address value - the address is 7bit and it's entered as bits 6..0 but sent as bits 7..1
Confusingly - addresses might be stated in either eight or seven bit form!
What device are you connecting to?
Martin
The address is shifted left one bit when sent - bit 0 is then read/write (1/0). transaction initialise should take the unshifted address value - the address is 7bit and it's entered as bits 6..0 but sent as bits 7..1
Confusingly - addresses might be stated in either eight or seven bit form!
What device are you connecting to?
Martin
Re: CAL_I2C Component Macro Connection problem
I was trying out an SSD1305 Display module with an I2C interface when I experienced this.
I used the SSD1306 Component Macro commands, but I overwrote the Display Initialization datas and used the CAL_I2C macro for this.
When I set 0x78 as the address in the "Transaction_Initialise" command, it sent the data to address 0xF0 and of course it didn't work.
When I set 0x3C, it sent the initialization data to address 0x78 and the display worked fine.
I have attached the test project.
Sasi
I used the SSD1306 Component Macro commands, but I overwrote the Display Initialization datas and used the CAL_I2C macro for this.
When I set 0x78 as the address in the "Transaction_Initialise" command, it sent the data to address 0xF0 and of course it didn't work.
When I set 0x3C, it sent the initialization data to address 0x78 and the display worked fine.
I have attached the test project.
Sasi
-
- Valued Contributor
- Posts: 1518
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 726 times
Re: CAL_I2C Component Macro Connection problem
0x3C is the correct i2c address (in 7 bit form) looks like the display component uses the 8 bit (pre-shifted) form. Consistency would be good!
The 7 bit form is much more usual - and personally I think life would be better if all components used this....
Great work on getting the display to work!
Martin
The 7 bit form is much more usual - and personally I think life would be better if all components used this....
Great work on getting the display to work!
Martin