Bonjour,
Voici mon problème, j’utilise un PIC18F4550 et j’ai fait un programme pour recevoir du RF par nRF24L01 et j’utilise un Real Time Clock DS1307 en même temps pour afficher l’horloge. Le problème c’est que ça ne fonctionne pas les deux en même temps dans le même programme?
J’ai fait deux programmes séparer pour voir si le RTC fonctionnait et j’ai fait la même chose pour le nRF24L01 et tous les deux fonctionne très bien!
Es que c’est possible que la communication SPI ne peux fonctionner en même temps que le I2C?
Merci
Chris
Communication SPI et I2C?
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Communication SPI et I2C?
Bonjour Chris,
Sur l'appareil 18F4550, les SPI et I2C utilisent le même périphérique MSSP et vous ne pouvez utiliser l'un ou l'autre qu'en mode matériel.
Vous pouvez probablement contourner le problème en initialisant le composant SPI, puis en exécutant les opérations SPI, puis en initialisant I2C, puis en exécutant les opérations I2C et en répétant.
Je conseillerais néanmoins de déplacer I2C ou SPI vers un canal logiciel et différentes broches E / S, ce qui devrait résoudre le problème pour vous.
Hello Chris,
On the 18F4550 device the SPI and I2C use the same MSSP peripheral and so you can only use one or the other in hardware mode.
You can probably work around the problem by initialising the SPI component and then performing SPI operations and then initialising the I2C and then performing I2C operations and repeating.
I would however advise moving either the I2C or SPI to a software channel and different I/O pins and this should solve the problem for you.
Sur l'appareil 18F4550, les SPI et I2C utilisent le même périphérique MSSP et vous ne pouvez utiliser l'un ou l'autre qu'en mode matériel.
Vous pouvez probablement contourner le problème en initialisant le composant SPI, puis en exécutant les opérations SPI, puis en initialisant I2C, puis en exécutant les opérations I2C et en répétant.
Je conseillerais néanmoins de déplacer I2C ou SPI vers un canal logiciel et différentes broches E / S, ce qui devrait résoudre le problème pour vous.
Hello Chris,
On the 18F4550 device the SPI and I2C use the same MSSP peripheral and so you can only use one or the other in hardware mode.
You can probably work around the problem by initialising the SPI component and then performing SPI operations and then initialising the I2C and then performing I2C operations and repeating.
I would however advise moving either the I2C or SPI to a software channel and different I/O pins and this should solve the problem for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Communication SPI et I2C?
Bonjour Benj,
Merci pour les informations, je voudrais savoir si je peux utiliser en même temps la communication SPI et RS232 ou si les SPI et RS232 utilisent le même périphérique MSSP ?
Merci
Chris
Merci pour les informations, je voudrais savoir si je peux utiliser en même temps la communication SPI et RS232 ou si les SPI et RS232 utilisent le même périphérique MSSP ?
Merci
Chris
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Communication SPI et I2C?
Salut chris,
Le RS232 ou UART utilise un périphérique UART complètement différent du périphérique MSSP. Il ne devrait pas y avoir de problème en utilisant SPI et RS232 en même temps.
Hi Chris,
The RS232 or UART uses a UART peripheral which is completely different from the MSSP peripheral. There should be no problems using SPI and RS232 at the same time.
Le RS232 ou UART utilise un périphérique UART complètement différent du périphérique MSSP. Il ne devrait pas y avoir de problème en utilisant SPI et RS232 en même temps.
Hi Chris,
The RS232 or UART uses a UART peripheral which is completely different from the MSSP peripheral. There should be no problems using SPI and RS232 at the same time.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel