OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 11:25 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MOSI- SPI
PostPosted: Sun Jan 28, 2024 9:36 pm 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Hello,

We are using SPI-1in Intel atom Elkhart lake, 0x6000

how to set the Idle state of MOSI line to high, right now its low, i.e before chip select is activated our device is expecting MOSI to be high

Note: Issue is with only idle state of MOSI, data is transmitted correctly

i tired googling this issue but unable to get right information

Thanks


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Jan 29, 2024 12:38 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
ravi wrote:
We are using SPI-1

Which one is that? There are several SPI controllers in there.

ravi wrote:
how to set the Idle state of MOSI line to high, right now its low, i.e before chip select is activated our device is expecting MOSI to be high

Your device is broken. It should ignore MOSI before chip select is activated.

I looked at the SPI configuration registers, but I didn't see anything about setting the idle state of the MOSI line directly. However, the MOSI line is (probably) multiplexed with a GPIO, so you could use the GPIO to set MOSI high while you're not using SPI.

If that doesn't work (or you'd rather fix it in hardware), use an OR gate to combine chip select and MOSI.


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Jan 29, 2024 2:40 pm 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
hello Octocontrabass,

its PCH SPI-1(SIO-SPI-1) (GSPI Controller #1:- D30:F3 - 4B2Bh)

i also did not find the settings to do that,,, following are my observations

the same device works with other controller(i have matched all the CS/ CLK PO/PH, only thing that is different in the other controller(old black box kind of legacy stuff) is that the MOSI is high in the idle state and when CS is activated MOSI line transition to actual bits)

then i noticed, PCH SPI supports only Motorola format

i thought that MOSI should not matter data should be shifted in on the clock as per what is selected

Thanks
Ravi


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Jan 29, 2024 3:56 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
ravi wrote:
its PCH SPI-1(SIO-SPI-1) (GSPI Controller #1:- D30:F3 - 4B2Bh)

You should be able to use PAD_CFG_DW0_GPPC_B_22 to force MOSI high.


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Jan 29, 2024 4:58 pm 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Thanks
Will try out bunch of other things along with this and let you guys know


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Thu Feb 01, 2024 9:19 am 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Hello Octocontrabass

It was a HW problem we have fixed it, thanks for your help

i have more question, can PCH GSPI mentioned above be configured in 24_bit mode(i only saw 4, 8,16, 32)

Thanks
Ravi


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Thu Feb 01, 2024 9:32 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
Try setting SSCR0.EDSS to 1 and SSCR.DSS to 0b0111.


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Fri Feb 02, 2024 12:44 pm 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Hello Octocontrabass

i tried doing that before, but it was setting to 32,(may i would have pushed bits here and there,), i will check again

one more question

when i write data to spi bus in SSDR to transmit, and then immediately monitor status bit 4 in SSSR, it does not show immediately as SPI controller as busy its taking some time to show the SPI controller as busy.

can provide your suggestions

Thanks
Ravi


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Fri Feb 02, 2024 1:49 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
ravi wrote:
when i write data to spi bus in SSDR to transmit, and then immediately monitor status bit 4 in SSSR, it does not show immediately as SPI controller as busy its taking some time to show the SPI controller as busy.

That sounds normal to me. It takes time for hardware to respond. You don't need to poll SSDR anyway, your driver should use interrupts.


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Apr 01, 2024 8:22 am 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Back on working on SPI

We are evaluating using interrupts(since it make our system less deterministic )


i trying DMA also, i had one more question regarding chip select

when i do a CS as software control, then how do get the accurate delay between CS going and SPI transmission(is manual delay function the only way)


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Apr 01, 2024 12:08 pm 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Hello Octocontrabass

i wanted to try implement SPI with DMA, but i am not getting any good documentation for elkhart lake,, all i have is 1 paragraph of few lines in 636112,, which does not detail anything

for example as per early experience with DMA on ARM, i need to know the bus matrix and channel allocation, to understand the data flow from memory to peripheral(vice versa)

do you know from where to get this data

thanks
Ravi


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Mon Apr 01, 2024 5:23 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
ravi wrote:
when i do a CS as software control, then how do get the accurate delay between CS going and SPI transmission(is manual delay function the only way)

The delays listed in the SSCR1.SPH description should occur whether CS is hardware or software controlled. If you need longer delays, you'll have to write your own delay function using a separate timer or counter.

ravi wrote:
i wanted to try implement SPI with DMA, but i am not getting any good documentation for elkhart lake,, all i have is 1 paragraph of few lines in 636112,, which does not detail anything

GSPI DMA is similar to PSE DMA, so you can read section 22.23 to understand how GSPI DMA works.


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Tue Apr 02, 2024 4:23 pm 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Thanks


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Fri Apr 05, 2024 8:40 am 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
Hello Octocontrabass

i am not trying to get the clock right as per calculation

Intel 636112-1.7 section 18.3.4

gives 2 examples

2) if set SSCR0.SCR to 0 and set CLOCK REGs M =8190 and N =32760
i should get 25 MHZ clock,, but i am getting only 1MHZ,, i change the ratio as per calculation given then also its givening me 1 mhz

1) by setting M:N = 1 and SCR =3 i was expecting to get 25mhz,, but i seeing 200khz

clock gating is disabled(ie. set to Hw_clk) not sure how the f_input is 100Mhz,,, is standard?

Thanks
Ravi


Top
 Profile  
 
 Post subject: Re: MOSI- SPI
PostPosted: Fri Apr 05, 2024 9:54 am 
Offline
Member
Member

Joined: Fri Sep 08, 2023 10:46 am
Posts: 41
It appears, is plug in my observed value w.r.t configured register value it appears f_input is 1Mhz,,,,not sure why


Thanks
Ravi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group