FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-05-2005, 04:31 PM
Marco
Guest
 
Posts: n/a
Default Connecting ADC to Opb_Spi core

Hallo,
I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.

Where I could find some software examples?

I have made some searches into Google but I don't have found anything.

The only example into EDK documentation is about an eeprom.

What is the meaning of :
Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
XSP_MANUAL_SSELECT_OPTION);

In this way ADC is a master?

When acquiring data, ADC must be set as a master?

Many Thanks in Advance
Marco


Reply With Quote
  #2 (permalink)  
Old 07-05-2005, 05:18 PM
Antti Lukats
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core

"Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
news:[email protected]
> Hallo,
> I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.
>
> Where I could find some software examples?
>
> I have made some searches into Google but I don't have found anything.
>
> The only example into EDK documentation is about an eeprom.
>
> What is the meaning of :
> Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
> XSP_MANUAL_SSELECT_OPTION);
>
> In this way ADC is a master?
>
> When acquiring data, ADC must be set as a master?
>
> Many Thanks in Advance
> Marco
>
>


1 there are no examples to be found by googling (my guess)
2 the meaning of what you asked is defined in the opb ip core manual, you
better read it

your setup seems to be OK, eg you set master and manual SS, that is you must
yourself
write to SS register to assert-deassert the ADC select signal

Antti
PS I almost always use a GPIO bit bang SPI emulation at first testing, the
soft SPI code is a only a few lines of C code. only when the software SPI
works with the connected hardware I proceed with special SPI hardware,
controlling hardware SPI is usually more complex (need to read the
manuals!!) then doing it 100% in sw.


Reply With Quote
  #3 (permalink)  
Old 07-05-2005, 05:45 PM
Marco
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core


"Antti Lukats" <[email protected]> wrote in message
news:[email protected]
> "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
> news:[email protected]
>> Hallo,
>> I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.
>>
>> Where I could find some software examples?
>>
>> I have made some searches into Google but I don't have found anything.
>>
>> The only example into EDK documentation is about an eeprom.
>>
>> What is the meaning of :
>> Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
>> XSP_MANUAL_SSELECT_OPTION);
>>
>> In this way ADC is a master?
>>
>> When acquiring data, ADC must be set as a master?
>>
>> Many Thanks in Advance
>> Marco
>>
>>

>
> 1 there are no examples to be found by googling (my guess)
> 2 the meaning of what you asked is defined in the opb ip core manual, you
> better read it
>
> your setup seems to be OK, eg you set master and manual SS, that is you
> must
> yourself
> write to SS register to assert-deassert the ADC select signal
>
> Antti
> PS I almost always use a GPIO bit bang SPI emulation at first testing, the
> soft SPI code is a only a few lines of C code. only when the software SPI
> works with the connected hardware I proceed with special SPI hardware,
> controlling hardware SPI is usually more complex (need to read the
> manuals!!) then doing it 100% in sw.
>
>


I posted because I don't have found the core manual very clear...

I have another doubt: ADC is 16 bit, but XSpi_Transfer works with 8 bit data
buffer.

That means to obtain a 16 data I must use 2 8bit buffers? In example a
vector of 2 elements?



Reply With Quote
  #4 (permalink)  
Old 07-05-2005, 06:01 PM
Antti Lukats
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core

"Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
news:[email protected]
>
> "Antti Lukats" <[email protected]> wrote in message
> news:[email protected]
> > "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
> > news:[email protected]
> >> Hallo,
> >> I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.
> >>
> >> Where I could find some software examples?
> >>
> >> I have made some searches into Google but I don't have found anything.
> >>
> >> The only example into EDK documentation is about an eeprom.
> >>
> >> What is the meaning of :
> >> Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
> >> XSP_MANUAL_SSELECT_OPTION);
> >>
> >> In this way ADC is a master?
> >>
> >> When acquiring data, ADC must be set as a master?
> >>
> >> Many Thanks in Advance
> >> Marco
> >>
> >>

> >
> > 1 there are no examples to be found by googling (my guess)
> > 2 the meaning of what you asked is defined in the opb ip core manual,

you
> > better read it
> >
> > your setup seems to be OK, eg you set master and manual SS, that is you
> > must
> > yourself
> > write to SS register to assert-deassert the ADC select signal
> >
> > Antti
> > PS I almost always use a GPIO bit bang SPI emulation at first testing,

the
> > soft SPI code is a only a few lines of C code. only when the software

SPI
> > works with the connected hardware I proceed with special SPI hardware,
> > controlling hardware SPI is usually more complex (need to read the
> > manuals!!) then doing it 100% in sw.
> >
> >

>
> I posted because I don't have found the core manual very clear...
>
> I have another doubt: ADC is 16 bit, but XSpi_Transfer works with 8 bit

data
> buffer.
>
> That means to obtain a 16 data I must use 2 8bit buffers? In example a
> vector of 2 elements?
>


no
you use MANUAL SS assertion, you already had that setup in your code snippet
actually

so you set SS active
do 8 bit transfer
do another 8 bit transfer
de assert SS

ADC 'sees' one 16 bit transfer

but I would says doing it that way is more complex and takes more time than
bitbang software method

Antti

















Reply With Quote
  #5 (permalink)  
Old 07-05-2005, 06:37 PM
Sylvain Munaut
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core

Hi Marco

> I posted because I don't have found the core manual very clear...
>
> I have another doubt: ADC is 16 bit, but XSpi_Transfer works with 8 bit data
> buffer.
>
> That means to obtain a 16 data I must use 2 8bit buffers? In example a
> vector of 2 elements?



Try reading your ADC manual.
Because SPI is more a matter of "Send 1 byte" "Read 1 byte" than what
the byte mean ... that all depends of the connected device.


Sylvain
Reply With Quote
  #6 (permalink)  
Old 07-05-2005, 08:58 PM
Antti Lukats
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core

"Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
news:[email protected]
>
> "Antti Lukats" <[email protected]> wrote in message
> news:[email protected]
> > "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
> > news:[email protected]
> >>
> >> "Antti Lukats" <[email protected]> wrote in message
> >> news:[email protected]
> >> > "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
> >> > news:[email protected]
> >> >> Hallo,
> >> >> I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.
> >> >>
> >> >> Where I could find some software examples?
> >> >>
> >> >> I have made some searches into Google but I don't have found

anything.
> >> >>
> >> >> The only example into EDK documentation is about an eeprom.
> >> >>
> >> >> What is the meaning of :
> >> >> Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
> >> >> XSP_MANUAL_SSELECT_OPTION);
> >> >>
> >> >> In this way ADC is a master?
> >> >>
> >> >> When acquiring data, ADC must be set as a master?
> >> >>
> >> >> Many Thanks in Advance
> >> >> Marco
> >> >>
> >> >>
> >> >
> >> > 1 there are no examples to be found by googling (my guess)
> >> > 2 the meaning of what you asked is defined in the opb ip core manual,

> > you
> >> > better read it
> >> >
> >> > your setup seems to be OK, eg you set master and manual SS, that is

you
> >> > must
> >> > yourself
> >> > write to SS register to assert-deassert the ADC select signal
> >> >
> >> > Antti
> >> > PS I almost always use a GPIO bit bang SPI emulation at first

testing,
> > the
> >> > soft SPI code is a only a few lines of C code. only when the software

> > SPI
> >> > works with the connected hardware I proceed with special SPI

hardware,
> >> > controlling hardware SPI is usually more complex (need to read the
> >> > manuals!!) then doing it 100% in sw.
> >> >
> >> >
> >>
> >> I posted because I don't have found the core manual very clear...
> >>
> >> I have another doubt: ADC is 16 bit, but XSpi_Transfer works with 8 bit

> > data
> >> buffer.
> >>
> >> That means to obtain a 16 data I must use 2 8bit buffers? In example a
> >> vector of 2 elements?
> >>

> >
> > no
> > you use MANUAL SS assertion, you already had that setup in your code
> > snippet
> > actually
> >
> > so you set SS active
> > do 8 bit transfer
> > do another 8 bit transfer
> > de assert SS
> >
> > ADC 'sees' one 16 bit transfer
> >
> > but I would says doing it that way is more complex and takes more time
> > than
> > bitbang software method
> >
> > Antti
> >
> >

>
> Could you explain what is bitbang software method, please?


you connect your ADC SPI to 'normal' GPIO ports and set/clear the bits in
software.

the C code is maybe 10 lines for the SPI

Antti











Reply With Quote
  #7 (permalink)  
Old 07-05-2005, 08:58 PM
Marco
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core


"Antti Lukats" <[email protected]> wrote in message
news:[email protected]
> "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
> news:[email protected]
>>
>> "Antti Lukats" <[email protected]> wrote in message
>> news:[email protected]
>> > "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
>> > news:[email protected]
>> >> Hallo,
>> >> I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.
>> >>
>> >> Where I could find some software examples?
>> >>
>> >> I have made some searches into Google but I don't have found anything.
>> >>
>> >> The only example into EDK documentation is about an eeprom.
>> >>
>> >> What is the meaning of :
>> >> Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
>> >> XSP_MANUAL_SSELECT_OPTION);
>> >>
>> >> In this way ADC is a master?
>> >>
>> >> When acquiring data, ADC must be set as a master?
>> >>
>> >> Many Thanks in Advance
>> >> Marco
>> >>
>> >>
>> >
>> > 1 there are no examples to be found by googling (my guess)
>> > 2 the meaning of what you asked is defined in the opb ip core manual,

> you
>> > better read it
>> >
>> > your setup seems to be OK, eg you set master and manual SS, that is you
>> > must
>> > yourself
>> > write to SS register to assert-deassert the ADC select signal
>> >
>> > Antti
>> > PS I almost always use a GPIO bit bang SPI emulation at first testing,

> the
>> > soft SPI code is a only a few lines of C code. only when the software

> SPI
>> > works with the connected hardware I proceed with special SPI hardware,
>> > controlling hardware SPI is usually more complex (need to read the
>> > manuals!!) then doing it 100% in sw.
>> >
>> >

>>
>> I posted because I don't have found the core manual very clear...
>>
>> I have another doubt: ADC is 16 bit, but XSpi_Transfer works with 8 bit

> data
>> buffer.
>>
>> That means to obtain a 16 data I must use 2 8bit buffers? In example a
>> vector of 2 elements?
>>

>
> no
> you use MANUAL SS assertion, you already had that setup in your code
> snippet
> actually
>
> so you set SS active
> do 8 bit transfer
> do another 8 bit transfer
> de assert SS
>
> ADC 'sees' one 16 bit transfer
>
> but I would says doing it that way is more complex and takes more time
> than
> bitbang software method
>
> Antti
>
>


Could you explain what is bitbang software method, please?



Reply With Quote
  #8 (permalink)  
Old 07-05-2005, 09:07 PM
Marco
Guest
 
Posts: n/a
Default Re: Connecting ADC to Opb_Spi core


"Antti Lukats" <[email protected]> wrote in message
news:[email protected]
> "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
> news:[email protected]
>>
>> "Antti Lukats" <[email protected]> wrote in message
>> news:[email protected]
>> > "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
>> > news:[email protected]
>> >>
>> >> "Antti Lukats" <[email protected]> wrote in message
>> >> news:[email protected]
>> >> > "Marco" <[email protected]_no_spam_email.it> schrieb im Newsbeitrag
>> >> > news:[email protected]
>> >> >> Hallo,
>> >> >> I'm trying to connect a Spi 16 bit ADC to Opb_Spi core.
>> >> >>
>> >> >> Where I could find some software examples?
>> >> >>
>> >> >> I have made some searches into Google but I don't have found

> anything.
>> >> >>
>> >> >> The only example into EDK documentation is about an eeprom.
>> >> >>
>> >> >> What is the meaning of :
>> >> >> Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION |
>> >> >> XSP_MANUAL_SSELECT_OPTION);
>> >> >>
>> >> >> In this way ADC is a master?
>> >> >>
>> >> >> When acquiring data, ADC must be set as a master?
>> >> >>
>> >> >> Many Thanks in Advance
>> >> >> Marco
>> >> >>
>> >> >>
>> >> >
>> >> > 1 there are no examples to be found by googling (my guess)
>> >> > 2 the meaning of what you asked is defined in the opb ip core
>> >> > manual,
>> > you
>> >> > better read it
>> >> >
>> >> > your setup seems to be OK, eg you set master and manual SS, that is

> you
>> >> > must
>> >> > yourself
>> >> > write to SS register to assert-deassert the ADC select signal
>> >> >
>> >> > Antti
>> >> > PS I almost always use a GPIO bit bang SPI emulation at first

> testing,
>> > the
>> >> > soft SPI code is a only a few lines of C code. only when the
>> >> > software
>> > SPI
>> >> > works with the connected hardware I proceed with special SPI

> hardware,
>> >> > controlling hardware SPI is usually more complex (need to read the
>> >> > manuals!!) then doing it 100% in sw.
>> >> >
>> >> >
>> >>
>> >> I posted because I don't have found the core manual very clear...
>> >>
>> >> I have another doubt: ADC is 16 bit, but XSpi_Transfer works with 8
>> >> bit
>> > data
>> >> buffer.
>> >>
>> >> That means to obtain a 16 data I must use 2 8bit buffers? In example a
>> >> vector of 2 elements?
>> >>
>> >
>> > no
>> > you use MANUAL SS assertion, you already had that setup in your code
>> > snippet
>> > actually
>> >
>> > so you set SS active
>> > do 8 bit transfer
>> > do another 8 bit transfer
>> > de assert SS
>> >
>> > ADC 'sees' one 16 bit transfer
>> >
>> > but I would says doing it that way is more complex and takes more time
>> > than
>> > bitbang software method
>> >
>> > Antti
>> >
>> >

>>
>> Could you explain what is bitbang software method, please?

>
> you connect your ADC SPI to 'normal' GPIO ports and set/clear the bits in
> software.
>
> the C code is maybe 10 lines for the SPI
>
> Antti
>
>


Ok, I'll try it!

Many Thanks to everyone for help and patience
Marco


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
why can't i use opb_spi core in EDK6.3? ARRON FPGA 5 06-02-2005 10:38 AM
Connecting FPU core on Virtex II Pro Matt Parks FPGA 1 02-06-2004 11:18 PM
connecting tristates Johan Bernspång FPGA 1 01-06-2004 12:43 AM


All times are GMT +1. The time now is 12:12 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved