View previous topic :: View next topic |
Author |
Message |
Tiny
Joined: 10 Nov 2010 Posts: 101 Location: The Netherlands
|
Posted: Mon Nov 24, 2014 8:33 pm Post subject: changing polarity off the sclk spi bus at runtime |
|
|
Hello,
i want to communicate with a MS5541C spi pressure senser.
but there for i need to change the polarity off the SCLK after sending 16 bits to read back the data.
how can i do that?
Regards Tiny
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon Nov 24, 2014 10:16 pm Post subject: |
|
|
If it's an XMega, do a re-Config, if it's for example an ATMega32, the bit CPOL in SPCR is responsible for clock polarity, depending on the sensors data sheet, you need to check CPHA too. |
|
Back to top |
|
|
Tiny
Joined: 10 Nov 2010 Posts: 101 Location: The Netherlands
|
Posted: Mon Nov 24, 2014 10:35 pm Post subject: |
|
|
sorry i forgot to tell which chip it was, it is a atmega644a |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon Nov 24, 2014 11:14 pm Post subject: |
|
|
Tiny wrote: | sorry i forgot to tell which chip it was, it is a atmega644a |
Also the ATMega644A has a datasheet and the registers and config-bits even have the same name. |
|
Back to top |
|
|
Tiny
Joined: 10 Nov 2010 Posts: 101 Location: The Netherlands
|
Posted: Tue Nov 25, 2014 6:39 am Post subject: |
|
|
Thank you, i found it |
|
Back to top |
|
|
Tiny
Joined: 10 Nov 2010 Posts: 101 Location: The Netherlands
|
Posted: Tue Nov 25, 2014 6:40 am Post subject: |
|
|
Thank you, i found it |
|
Back to top |
|
|
|