Problem with SSI port in LM3S8962

classic Classic list List threaded Threaded
10 messages Options
César Raúl Mamani Choquehuanca César Raúl Mamani Choquehuanca
Reply | Threaded
Open this post in threaded view
|

Problem with SSI port in LM3S8962

Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

Hi,

I'm sorry, I'm afraid I didn't understand your problem. Could you please explain it in more detail?

Thanks,
Bogdan

On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]> wrote:
Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
César Raúl Mamani Choquehuanca César Raúl Mamani Choquehuanca
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

Hi Bogdan,
 
You right, i not explained very well my problem. My problem was what i can write anything in the hyperterminal windows, but after read the datasheet of lm3s8962 i can repair that, i forgot to remove the J9 (SSIFss) in the target of luminary, well now i can program but i cant use the port SS well im using of module SPI as explain in the site of elua. i dont sure if im doing right.

My code is :

if pd.board()~="EK-LM3S8962" then
        print "Unsoported board"
        return
end
id=0
type=spi.MASTER
clock=200000
cpol=1
cpha=0
databits=12

--clock=spi.setup(id,type,clock,cpol,cpha,databits)

--Draw static text on terminal
term.clrscr()
term.gotoxy(1,1)
term.putstr("Letura do SSI Gyroscopio\n")

local data
local key

while true do
        clock=spi.setup(id,type,clock,cpol,cpha,databits)
--      spi.sson(id)
        spi.readwrite(id,data)
--      spi.ssoff(id)
        term.gotoxy(1,4)
        term.putstr(string.format("letura gyroscopio: %02d\n",data))
        key=term.getch(term.NOWAIT)
        if key==term.KC_ESC then break end --exit if user hits Escape
end
term.clrscr()
term.gotoxy(1,1)

I read in some forum what for data acquisition the target have to be in slave mode but i dont sure again.

Best
--
César R. Mamani Ch.



2009/8/3 Bogdan Marinescu <[hidden email]>
Hi,

I'm sorry, I'm afraid I didn't understand your problem. Could you please explain it in more detail?

Thanks,
Bogdan

On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]> wrote:
Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev






_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

I've just been experimenting with SPI myself a little on LM3S, and for  
some reason the clock pin doesn't seem to be doing anything.

With regards to your code below, however, when you call the following:
> spi.readwrite(id,data)

Data doesn't get updated with the contents of what's read, it is  
returned in a table:
freshdata = spi.readwrite(id,data)

then, say, if there's only one 12-bit chunk returned, presumably you  
just need to do:
> term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))

(at least I think so :-)

Also, sson & ssoff don't actually control a pin on LM3S at the moment,  
so you may need to toggle a pin yourself, i.e.:

pio.pin.setdir(pio.OUTPUT, pio.PA_7)
pio.pin.setval(0, pio.PA_7)
freshdata = spi.readwrite(id,data)
pio.pin.setval(1, pio.PA_7)

Does your clock line work for you?

On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:

> Hi Bogdan,
>
> You right, i not explained very well my problem. My problem was what  
> i can write anything in the hyperterminal windows, but after read  
> the datasheet of lm3s8962 i can repair that, i forgot to remove the  
> J9 (SSIFss) in the target of luminary, well now i can program but i  
> cant use the port SS well im using of module SPI as explain in the  
> site of elua. i dont sure if im doing right.
>
> My code is :
>
> if pd.board()~="EK-LM3S8962" then
>         print "Unsoported board"
>         return
> end
> id=0
> type=spi.MASTER
> clock=200000
> cpol=1
> cpha=0
> databits=12
>
> --clock=spi.setup(id,type,clock,cpol,cpha,databits)
>
> --Draw static text on terminal
> term.clrscr()
> term.gotoxy(1,1)
> term.putstr("Letura do SSI Gyroscopio\n")
>
> local data
> local key
>
> while true do
>         clock=spi.setup(id,type,clock,cpol,cpha,databits)
> --      spi.sson(id)
>         spi.readwrite(id,data)
> --      spi.ssoff(id)
>         term.gotoxy(1,4)
>         term.putstr(string.format("letura gyroscopio: %02d\n",data))
>         key=term.getch(term.NOWAIT)
>         if key==term.KC_ESC then break end --exit if user hits Escape
> end
> term.clrscr()
> term.gotoxy(1,1)
>
> I read in some forum what for data acquisition the target have to be  
> in slave mode but i dont sure again.
>
> Best
> --
> César R. Mamani Ch.
>
>
>
> 2009/8/3 Bogdan Marinescu <[hidden email]>
> Hi,
>
> I'm sorry, I'm afraid I didn't understand your problem. Could you  
> please explain it in more detail?
>
> Thanks,
> Bogdan
>
> On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]
> > wrote:
> Hi All,
>
> Im working with module Ek-LM3S8962, i need to use SSI port for data  
> acquisition but i cant program that when i have plugged my sensor  
> (gyroscopic) to target without energy in the sensor. I can program  
> when i have unplugged the sensor of the target. Im using the  
> hyperterminal for that. Any suggestion for that? i need to see  
> online my data in the hyperterminal.
>
> Best
>
> --
> César R. Mamani Ch.
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

smime.p7s (5K) Download Attachment
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

On Fri, Aug 7, 2009 at 4:35 AM, James Snyder <[hidden email]> wrote:
I've just been experimenting with SPI myself a little on LM3S, and for some reason the clock pin doesn't seem to be doing anything.

This is indeed weird. It looks as though the SPI interface isn't initialized properly, or it somehow gets initialized into slave mode for some reason. I'll try to check a SPI example from the official LM3S peripheral library. If that works (and I suspect it does) we need to look for errors in our platform code.
 
then, say, if there's only one 12-bit chunk returned, presumably you just need to do:
term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))

(at least I think so :-)

Yup, that's how it should work (I didn't work with the SPI module too much tough).
 
Also, sson & ssoff don't actually control a pin on LM3S at the moment, so you may need to toggle a pin yourself, i.e.:

I think I'll remove that from the spi interface module and add it only as platform-specific modules if needed, as it seems that sson/ssoff don't do anything on most platforms. 

Best,
Bogdan

On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:

Hi Bogdan,

You right, i not explained very well my problem. My problem was what i can write anything in the hyperterminal windows, but after read the datasheet of lm3s8962 i can repair that, i forgot to remove the J9 (SSIFss) in the target of luminary, well now i can program but i cant use the port SS well im using of module SPI as explain in the site of elua. i dont sure if im doing right.

My code is :

if pd.board()~="EK-LM3S8962" then
       print "Unsoported board"
       return
end
id=0
type=spi.MASTER
clock=200000
cpol=1
cpha=0
databits=12

--clock=spi.setup(id,type,clock,cpol,cpha,databits)

--Draw static text on terminal
term.clrscr()
term.gotoxy(1,1)
term.putstr("Letura do SSI Gyroscopio\n")

local data
local key

while true do
       clock=spi.setup(id,type,clock,cpol,cpha,databits)
--      spi.sson(id)
       spi.readwrite(id,data)
--      spi.ssoff(id)
       term.gotoxy(1,4)
       term.putstr(string.format("letura gyroscopio: %02d\n",data))
       key=term.getch(term.NOWAIT)
       if key==term.KC_ESC then break end --exit if user hits Escape
end
term.clrscr()
term.gotoxy(1,1)

I read in some forum what for data acquisition the target have to be in slave mode but i dont sure again.

Best
--
César R. Mamani Ch.



2009/8/3 Bogdan Marinescu <[hidden email]>
Hi,

I'm sorry, I'm afraid I didn't understand your problem. Could you please explain it in more detail?

Thanks,
Bogdan

On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]> wrote:
Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

OK, found an error there that prevented the SPI interface from working :) Please update the sources, rebuild and try again.

Thanks,
Bogdan

On Fri, Aug 7, 2009 at 10:32 AM, Bogdan Marinescu <[hidden email]> wrote:
On Fri, Aug 7, 2009 at 4:35 AM, James Snyder <[hidden email]> wrote:
I've just been experimenting with SPI myself a little on LM3S, and for some reason the clock pin doesn't seem to be doing anything.

This is indeed weird. It looks as though the SPI interface isn't initialized properly, or it somehow gets initialized into slave mode for some reason. I'll try to check a SPI example from the official LM3S peripheral library. If that works (and I suspect it does) we need to look for errors in our platform code.
 
then, say, if there's only one 12-bit chunk returned, presumably you just need to do:
term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))

(at least I think so :-)

Yup, that's how it should work (I didn't work with the SPI module too much tough).
 
Also, sson & ssoff don't actually control a pin on LM3S at the moment, so you may need to toggle a pin yourself, i.e.:

I think I'll remove that from the spi interface module and add it only as platform-specific modules if needed, as it seems that sson/ssoff don't do anything on most platforms. 

Best,
Bogdan

On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:

Hi Bogdan,

You right, i not explained very well my problem. My problem was what i can write anything in the hyperterminal windows, but after read the datasheet of lm3s8962 i can repair that, i forgot to remove the J9 (SSIFss) in the target of luminary, well now i can program but i cant use the port SS well im using of module SPI as explain in the site of elua. i dont sure if im doing right.

My code is :

if pd.board()~="EK-LM3S8962" then
       print "Unsoported board"
       return
end
id=0
type=spi.MASTER
clock=200000
cpol=1
cpha=0
databits=12

--clock=spi.setup(id,type,clock,cpol,cpha,databits)

--Draw static text on terminal
term.clrscr()
term.gotoxy(1,1)
term.putstr("Letura do SSI Gyroscopio\n")

local data
local key

while true do
       clock=spi.setup(id,type,clock,cpol,cpha,databits)
--      spi.sson(id)
       spi.readwrite(id,data)
--      spi.ssoff(id)
       term.gotoxy(1,4)
       term.putstr(string.format("letura gyroscopio: %02d\n",data))
       key=term.getch(term.NOWAIT)
       if key==term.KC_ESC then break end --exit if user hits Escape
end
term.clrscr()
term.gotoxy(1,1)

I read in some forum what for data acquisition the target have to be in slave mode but i dont sure again.

Best
--
César R. Mamani Ch.



2009/8/3 Bogdan Marinescu <[hidden email]>
Hi,

I'm sorry, I'm afraid I didn't understand your problem. Could you please explain it in more detail?

Thanks,
Bogdan

On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]> wrote:
Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev




_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

Thanks!  I'll try it out again.

One quick thought regarding the following however:
   // FIXME: not sure this is always "right"
-  MAP_GPIOPadConfigSet(spi_gpio_base[ id ], spi_gpio_clk_pin[ id ],  
GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);
+  // MAP_GPIOPadConfigSet(spi_gpio_base[ id ],  
spi_gpio_clk_pin[ id ], GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);

I see from some of the other SPI examples that all of the SPI pins are  
put into pullup with either 8MA or 4MA strength is this what  
ultimately broke/fixed the issue?  I'm not sure what the default pin  
configuration is, but I would assume that this might be relevant if  
someone, say, switch one of the pins to manual control and then want  
to switch back to SPI (which is done during setup of the RIT display,  
for example).

I'll do a bit of testing since I'm working on some SPI interfacing  
today.

On Aug 7, 2009, at 4:21 AM, Bogdan Marinescu wrote:

> OK, found an error there that prevented the SPI interface from  
> working :) Please update the sources, rebuild and try again.
>
> Thanks,
> Bogdan
>
> On Fri, Aug 7, 2009 at 10:32 AM, Bogdan Marinescu <[hidden email]
> > wrote:
> On Fri, Aug 7, 2009 at 4:35 AM, James Snyder  
> <[hidden email]> wrote:
> I've just been experimenting with SPI myself a little on LM3S, and  
> for some reason the clock pin doesn't seem to be doing anything.
>
> This is indeed weird. It looks as though the SPI interface isn't  
> initialized properly, or it somehow gets initialized into slave mode  
> for some reason. I'll try to check a SPI example from the official  
> LM3S peripheral library. If that works (and I suspect it does) we  
> need to look for errors in our platform code.
>
> then, say, if there's only one 12-bit chunk returned, presumably you  
> just need to do:
> term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))
>
> (at least I think so :-)
>
> Yup, that's how it should work (I didn't work with the SPI module  
> too much tough).
>
> Also, sson & ssoff don't actually control a pin on LM3S at the  
> moment, so you may need to toggle a pin yourself, i.e.:
>
> I think I'll remove that from the spi interface module and add it  
> only as platform-specific modules if needed, as it seems that sson/
> ssoff don't do anything on most platforms.
>
> Best,
> Bogdan
>
> On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:
>
> Hi Bogdan,
>
> You right, i not explained very well my problem. My problem was what  
> i can write anything in the hyperterminal windows, but after read  
> the datasheet of lm3s8962 i can repair that, i forgot to remove the  
> J9 (SSIFss) in the target of luminary, well now i can program but i  
> cant use the port SS well im using of module SPI as explain in the  
> site of elua. i dont sure if im doing right.
>
> My code is :
>
> if pd.board()~="EK-LM3S8962" then
>        print "Unsoported board"
>        return
> end
> id=0
> type=spi.MASTER
> clock=200000
> cpol=1
> cpha=0
> databits=12
>
> --clock=spi.setup(id,type,clock,cpol,cpha,databits)
>
> --Draw static text on terminal
> term.clrscr()
> term.gotoxy(1,1)
> term.putstr("Letura do SSI Gyroscopio\n")
>
> local data
> local key
>
> while true do
>        clock=spi.setup(id,type,clock,cpol,cpha,databits)
> --      spi.sson(id)
>        spi.readwrite(id,data)
> --      spi.ssoff(id)
>        term.gotoxy(1,4)
>        term.putstr(string.format("letura gyroscopio: %02d\n",data))
>        key=term.getch(term.NOWAIT)
>        if key==term.KC_ESC then break end --exit if user hits Escape
> end
> term.clrscr()
> term.gotoxy(1,1)
>
> I read in some forum what for data acquisition the target have to be  
> in slave mode but i dont sure again.
>
> Best
> --
> César R. Mamani Ch.
>
>
>
> 2009/8/3 Bogdan Marinescu <[hidden email]>
> Hi,
>
> I'm sorry, I'm afraid I didn't understand your problem. Could you  
> please explain it in more detail?
>
> Thanks,
> Bogdan
>
> On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]
> > wrote:
> Hi All,
>
> Im working with module Ek-LM3S8962, i need to use SSI port for data  
> acquisition but i cant program that when i have plugged my sensor  
> (gyroscopic) to target without energy in the sensor. I can program  
> when i have unplugged the sensor of the target. Im using the  
> hyperterminal for that. Any suggestion for that? i need to see  
> online my data in the hyperterminal.
>
> Best
>
> --
> César R. Mamani Ch.
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
> --
> James Snyder
> Biomedical Engineering
> Northwestern University
> [hidden email]
> http://fanplastic.org/key.txt
> ph: 847.448.0386
>
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

smime.p7s (5K) Download Attachment
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962



On Fri, Aug 7, 2009 at 5:40 PM, James Snyder <[hidden email]> wrote:
Thanks!  I'll try it out again.

One quick thought regarding the following however:
 // FIXME: not sure this is always "right"
-  MAP_GPIOPadConfigSet(spi_gpio_base[ id ], spi_gpio_clk_pin[ id ], GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);
+  // MAP_GPIOPadConfigSet(spi_gpio_base[ id ], spi_gpio_clk_pin[ id ], GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);

I see from some of the other SPI examples that all of the SPI pins are put into pullup with either 8MA or 4MA strength is this what ultimately broke/fixed the issue?  

It's actually an array that was declared with a "|" instead of a "," a few lines higher :D I don't really think that the strength is relevant, 4mA should be more than enough to drive any SPI peripheral. About the pullup, see below.
 
I'm not sure what the default pin configuration is, but I would assume that this might be relevant if someone, say, switch one of the pins to manual control and then want to switch back to SPI (which is done during setup of the RIT display, for example).

I don't see why one would want to pull up the clock, since depending on the SPI configuration (the CPOL/CPHA combination) the clock might be in the "idle" state if it is high OR low. And declaring the clock pin as a regular push/pull line (which is the default) should do the trick just fine. Maybe I don't understand that line good enough.
The manual control, on the other hand, might indeed be an issue. We should test this.
 
I'll do a bit of testing since I'm working on some SPI interfacing today.

Please let me know how (if?) it works.

Thanks,
Bogdan
 
On Aug 7, 2009, at 4:21 AM, Bogdan Marinescu wrote:

OK, found an error there that prevented the SPI interface from working :) Please update the sources, rebuild and try again.

Thanks,
Bogdan

On Fri, Aug 7, 2009 at 10:32 AM, Bogdan Marinescu <[hidden email]> wrote:
On Fri, Aug 7, 2009 at 4:35 AM, James Snyder <[hidden email]> wrote:
I've just been experimenting with SPI myself a little on LM3S, and for some reason the clock pin doesn't seem to be doing anything.

This is indeed weird. It looks as though the SPI interface isn't initialized properly, or it somehow gets initialized into slave mode for some reason. I'll try to check a SPI example from the official LM3S peripheral library. If that works (and I suspect it does) we need to look for errors in our platform code.

then, say, if there's only one 12-bit chunk returned, presumably you just need to do:
term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))

(at least I think so :-)

Yup, that's how it should work (I didn't work with the SPI module too much tough).

Also, sson & ssoff don't actually control a pin on LM3S at the moment, so you may need to toggle a pin yourself, i.e.:

I think I'll remove that from the spi interface module and add it only as platform-specific modules if needed, as it seems that sson/ssoff don't do anything on most platforms.

Best,
Bogdan

On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:

Hi Bogdan,

You right, i not explained very well my problem. My problem was what i can write anything in the hyperterminal windows, but after read the datasheet of lm3s8962 i can repair that, i forgot to remove the J9 (SSIFss) in the target of luminary, well now i can program but i cant use the port SS well im using of module SPI as explain in the site of elua. i dont sure if im doing right.

My code is :

if pd.board()~="EK-LM3S8962" then
      print "Unsoported board"
      return
end
id=0
type=spi.MASTER
clock=200000
cpol=1
cpha=0
databits=12

--clock=spi.setup(id,type,clock,cpol,cpha,databits)

--Draw static text on terminal
term.clrscr()
term.gotoxy(1,1)
term.putstr("Letura do SSI Gyroscopio\n")

local data
local key

while true do
      clock=spi.setup(id,type,clock,cpol,cpha,databits)
--      spi.sson(id)
      spi.readwrite(id,data)
--      spi.ssoff(id)
      term.gotoxy(1,4)
      term.putstr(string.format("letura gyroscopio: %02d\n",data))
      key=term.getch(term.NOWAIT)
      if key==term.KC_ESC then break end --exit if user hits Escape
end
term.clrscr()
term.gotoxy(1,1)

I read in some forum what for data acquisition the target have to be in slave mode but i dont sure again.

Best
--
César R. Mamani Ch.



2009/8/3 Bogdan Marinescu <[hidden email]>
Hi,

I'm sorry, I'm afraid I didn't understand your problem. Could you please explain it in more detail?

Thanks,
Bogdan

On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]> wrote:
Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
César Raúl Mamani Choquehuanca César Raúl Mamani Choquehuanca
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

Hi All,
 
I had some problem with my computer well i return.
 
             Does your clock line work for you?
James, It doesnt work for me too :(
 
I maked
 
             pio.pin.setdir(pio.OUTPUT, pio.PA_7)
             pio.pin.setval(0, pio.PA_7)
             freshdata = spi.readwrite(id,data)
             pio.pin.setval(1, pio.PA_7)
but if the clock doesnt work, i think i cant read anything of my sensor (it need a clock from controller). i tested my sensor with signal generator.
 
the good new is the module PWM and ADC working very good for me.
 
Any idea of SSI problem? well i think the clock problem. I help a lot :(
 
Best

--
César R. Mamani Ch.
 
 
2009/8/7 Bogdan Marinescu <[hidden email]>


On Fri, Aug 7, 2009 at 5:40 PM, James Snyder <[hidden email]> wrote:
Thanks!  I'll try it out again.

One quick thought regarding the following however:
 // FIXME: not sure this is always "right"
-  MAP_GPIOPadConfigSet(spi_gpio_base[ id ], spi_gpio_clk_pin[ id ], GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);
+  // MAP_GPIOPadConfigSet(spi_gpio_base[ id ], spi_gpio_clk_pin[ id ], GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);

I see from some of the other SPI examples that all of the SPI pins are put into pullup with either 8MA or 4MA strength is this what ultimately broke/fixed the issue?  

It's actually an array that was declared with a "|" instead of a "," a few lines higher :D I don't really think that the strength is relevant, 4mA should be more than enough to drive any SPI peripheral. About the pullup, see below.
 
I'm not sure what the default pin configuration is, but I would assume that this might be relevant if someone, say, switch one of the pins to manual control and then want to switch back to SPI (which is done during setup of the RIT display, for example).

I don't see why one would want to pull up the clock, since depending on the SPI configuration (the CPOL/CPHA combination) the clock might be in the "idle" state if it is high OR low. And declaring the clock pin as a regular push/pull line (which is the default) should do the trick just fine. Maybe I don't understand that line good enough.
The manual control, on the other hand, might indeed be an issue. We should test this.
 
I'll do a bit of testing since I'm working on some SPI interfacing today.

Please let me know how (if?) it works.

Thanks,
Bogdan
 
On Aug 7, 2009, at 4:21 AM, Bogdan Marinescu wrote:

OK, found an error there that prevented the SPI interface from working :) Please update the sources, rebuild and try again.

Thanks,
Bogdan

On Fri, Aug 7, 2009 at 10:32 AM, Bogdan Marinescu <[hidden email]> wrote:
On Fri, Aug 7, 2009 at 4:35 AM, James Snyder <[hidden email]> wrote:
I've just been experimenting with SPI myself a little on LM3S, and for some reason the clock pin doesn't seem to be doing anything.

This is indeed weird. It looks as though the SPI interface isn't initialized properly, or it somehow gets initialized into slave mode for some reason. I'll try to check a SPI example from the official LM3S peripheral library. If that works (and I suspect it does) we need to look for errors in our platform code.

then, say, if there's only one 12-bit chunk returned, presumably you just need to do:
term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))

(at least I think so :-)

Yup, that's how it should work (I didn't work with the SPI module too much tough).

Also, sson & ssoff don't actually control a pin on LM3S at the moment, so you may need to toggle a pin yourself, i.e.:

I think I'll remove that from the spi interface module and add it only as platform-specific modules if needed, as it seems that sson/ssoff don't do anything on most platforms.

Best,
Bogdan

On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:

Hi Bogdan,

You right, i not explained very well my problem. My problem was what i can write anything in the hyperterminal windows, but after read the datasheet of lm3s8962 i can repair that, i forgot to remove the J9 (SSIFss) in the target of luminary, well now i can program but i cant use the port SS well im using of module SPI as explain in the site of elua. i dont sure if im doing right.

My code is :

if pd.board()~="EK-LM3S8962" then
      print "Unsoported board"
      return
end
id=0
type=spi.MASTER
clock=200000
cpol=1
cpha=0
databits=12

--clock=spi.setup(id,type,clock,cpol,cpha,databits)

--Draw static text on terminal
term.clrscr()
term.gotoxy(1,1)
term.putstr("Letura do SSI Gyroscopio\n")

local data
local key

while true do
      clock=spi.setup(id,type,clock,cpol,cpha,databits)
--      spi.sson(id)
      spi.readwrite(id,data)
--      spi.ssoff(id)
      term.gotoxy(1,4)
      term.putstr(string.format("letura gyroscopio: %02d\n",data))
      key=term.getch(term.NOWAIT)
      if key==term.KC_ESC then break end --exit if user hits Escape
end
term.clrscr()
term.gotoxy(1,1)

I read in some forum what for data acquisition the target have to be in slave mode but i dont sure again.

Best
--
César R. Mamani Ch.



2009/8/3 Bogdan Marinescu <[hidden email]>
Hi,

I'm sorry, I'm afraid I didn't understand your problem. Could you please explain it in more detail?

Thanks,
Bogdan

On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]> wrote:
Hi All,

Im working with module Ek-LM3S8962, i need to use SSI port for data acquisition but i cant program that when i have plugged my sensor (gyroscopic) to target without energy in the sensor. I can program when i have unplugged the sensor of the target. Im using the hyperterminal for that. Any suggestion for that? i need to see online my data in the hyperterminal.

Best

--
César R. Mamani Ch.


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SSI port in LM3S8962

Hmm.. I'm actually no longer having trouble with my setup.  Are you  
running the latest revision from trunk? Have you tried using a scope  
in triggered mode to see if anything is happening on the lines in  
question?  You should see something on the SSICLK line for the clock,  
and if you write some data out, you should see some oscillations on  
your SSITX.

The following works for me on a 6965:

-- Note that PA_7 on my board is SDA1, which I'm using for chip select

spi.setup(0,spi.MASTER,100000,0,1,16)
pio.pin.setdir(pio.OUTPUT, pio.PA_7)

pio.pin.setval(0, pio.PA_7)
freshdata = spi.readwrite(0,23)
pio.pin.setval(1, pio.PA_7)

Side note: I'll likely just write a few lined function to do this, but  
it would be nice to be able to tie a particular pin to be chip select  
such that when readwrite is executed it toggles it automatically.

On Aug 12, 2009, at 1:55 PM, César Raúl Mamani Choquehuanca wrote:

> Hi All,
>
> I had some problem with my computer well i return.
>
>              Does your clock line work for you?
> James, It doesnt work for me too :(
>
> I maked
>
>              pio.pin.setdir(pio.OUTPUT, pio.PA_7)
>              pio.pin.setval(0, pio.PA_7)
>              freshdata = spi.readwrite(id,data)
>              pio.pin.setval(1, pio.PA_7)
> but if the clock doesnt work, i think i cant read anything of my  
> sensor (it need a clock from controller). i tested my sensor with  
> signal generator.
>
> the good new is the module PWM and ADC working very good for me.
>
> Any idea of SSI problem? well i think the clock problem. I help a  
> lot :(
>
> Best
>
> --
> César R. Mamani Ch.
>
>
> 2009/8/7 Bogdan Marinescu <[hidden email]>
>
>
> On Fri, Aug 7, 2009 at 5:40 PM, James Snyder  
> <[hidden email]> wrote:
> Thanks!  I'll try it out again.
>
> One quick thought regarding the following however:
>  // FIXME: not sure this is always "right"
> -  MAP_GPIOPadConfigSet(spi_gpio_base[ id ], spi_gpio_clk_pin[ id ],  
> GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);
> +  // MAP_GPIOPadConfigSet(spi_gpio_base[ id ],  
> spi_gpio_clk_pin[ id ], GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);
>
> I see from some of the other SPI examples that all of the SPI pins  
> are put into pullup with either 8MA or 4MA strength is this what  
> ultimately broke/fixed the issue?
>
> It's actually an array that was declared with a "|" instead of a ","  
> a few lines higher :D I don't really think that the strength is  
> relevant, 4mA should be more than enough to drive any SPI  
> peripheral. About the pullup, see below.
>
> I'm not sure what the default pin configuration is, but I would  
> assume that this might be relevant if someone, say, switch one of  
> the pins to manual control and then want to switch back to SPI  
> (which is done during setup of the RIT display, for example).
>
> I don't see why one would want to pull up the clock, since depending  
> on the SPI configuration (the CPOL/CPHA combination) the clock might  
> be in the "idle" state if it is high OR low. And declaring the clock  
> pin as a regular push/pull line (which is the default) should do the  
> trick just fine. Maybe I don't understand that line good enough.
> The manual control, on the other hand, might indeed be an issue. We  
> should test this.
>
> I'll do a bit of testing since I'm working on some SPI interfacing  
> today.
>
> Please let me know how (if?) it works.
>
> Thanks,
> Bogdan
>
> On Aug 7, 2009, at 4:21 AM, Bogdan Marinescu wrote:
>
> OK, found an error there that prevented the SPI interface from  
> working :) Please update the sources, rebuild and try again.
>
> Thanks,
> Bogdan
>
> On Fri, Aug 7, 2009 at 10:32 AM, Bogdan Marinescu <[hidden email]
> > wrote:
> On Fri, Aug 7, 2009 at 4:35 AM, James Snyder  
> <[hidden email]> wrote:
> I've just been experimenting with SPI myself a little on LM3S, and  
> for some reason the clock pin doesn't seem to be doing anything.
>
> This is indeed weird. It looks as though the SPI interface isn't  
> initialized properly, or it somehow gets initialized into slave mode  
> for some reason. I'll try to check a SPI example from the official  
> LM3S peripheral library. If that works (and I suspect it does) we  
> need to look for errors in our platform code.
>
> then, say, if there's only one 12-bit chunk returned, presumably you  
> just need to do:
> term.putstr(string.format("letura gyroscopio: %02d\n",freshdata[1]))
>
> (at least I think so :-)
>
> Yup, that's how it should work (I didn't work with the SPI module  
> too much tough).
>
> Also, sson & ssoff don't actually control a pin on LM3S at the  
> moment, so you may need to toggle a pin yourself, i.e.:
>
> I think I'll remove that from the spi interface module and add it  
> only as platform-specific modules if needed, as it seems that sson/
> ssoff don't do anything on most platforms.
>
> Best,
> Bogdan
>
> On Aug 4, 2009, at 7:10 AM, César Raúl Mamani Choquehuanca wrote:
>
> Hi Bogdan,
>
> You right, i not explained very well my problem. My problem was what  
> i can write anything in the hyperterminal windows, but after read  
> the datasheet of lm3s8962 i can repair that, i forgot to remove the  
> J9 (SSIFss) in the target of luminary, well now i can program but i  
> cant use the port SS well im using of module SPI as explain in the  
> site of elua. i dont sure if im doing right.
>
> My code is :
>
> if pd.board()~="EK-LM3S8962" then
>       print "Unsoported board"
>       return
> end
> id=0
> type=spi.MASTER
> clock=200000
> cpol=1
> cpha=0
> databits=12
>
> --clock=spi.setup(id,type,clock,cpol,cpha,databits)
>
> --Draw static text on terminal
> term.clrscr()
> term.gotoxy(1,1)
> term.putstr("Letura do SSI Gyroscopio\n")
>
> local data
> local key
>
> while true do
>       clock=spi.setup(id,type,clock,cpol,cpha,databits)
> --      spi.sson(id)
>       spi.readwrite(id,data)
> --      spi.ssoff(id)
>       term.gotoxy(1,4)
>       term.putstr(string.format("letura gyroscopio: %02d\n",data))
>       key=term.getch(term.NOWAIT)
>       if key==term.KC_ESC then break end --exit if user hits Escape
> end
> term.clrscr()
> term.gotoxy(1,1)
>
> I read in some forum what for data acquisition the target have to be  
> in slave mode but i dont sure again.
>
> Best
> --
> César R. Mamani Ch.
>
>
>
> 2009/8/3 Bogdan Marinescu <[hidden email]>
> Hi,
>
> I'm sorry, I'm afraid I didn't understand your problem. Could you  
> please explain it in more detail?
>
> Thanks,
> Bogdan
>
> On Sun, Aug 2, 2009 at 11:08 AM, César Raúl Mamani Choquehuanca <[hidden email]
> > wrote:
> Hi All,
>
> Im working with module Ek-LM3S8962, i need to use SSI port for data  
> acquisition but i cant program that when i have plugged my sensor  
> (gyroscopic) to target without energy in the sensor. I can program  
> when i have unplugged the sensor of the target. Im using the  
> hyperterminal for that. Any suggestion for that? i need to see  
> online my data in the hyperterminal.
>
> Best
>
> --
> César R. Mamani Ch.
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
> --
> James Snyder
> Biomedical Engineering
> Northwestern University
> [hidden email]
> http://fanplastic.org/key.txt
> ph: 847.448.0386
>
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
> --
> James Snyder
> Biomedical Engineering
> Northwestern University
> [hidden email]
> http://fanplastic.org/key.txt
> ph: 847.448.0386
>
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
>
> _______________________________________________
> Elua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: 847.448.0386





_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

smime.p7s (5K) Download Attachment