Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

SPI clock

Based on DMP's Vortex processor / SoC this board is a full computer capable of running a standard Windows and Linux installation on the backpack of your robot.
11 postsPage 1 of 1
11 postsPage 1 of 1

SPI clock

Post by SoBot » Fri Apr 16, 2010 12:05 pm

Post by SoBot
Fri Apr 16, 2010 12:05 pm

I am usign the spi to communicate to a slave device. For some reason there is no signal on any of the clock outputs when I write to the spi. On my scope I can see a signal on the data output but not on the clock. What am I missing? Here is the code:

if (spi_Initialize(SPICLK_10000KHZ))
{
for (int i = 1;i < 20;i++)
spi_Write(0x01);

cout << "Write to spi" << endl;
} else cout << roboio_GetErrMsg();

spi_Close();
I am usign the spi to communicate to a slave device. For some reason there is no signal on any of the clock outputs when I write to the spi. On my scope I can see a signal on the data output but not on the clock. What am I missing? Here is the code:

if (spi_Initialize(SPICLK_10000KHZ))
{
for (int i = 1;i < 20;i++)
spi_Write(0x01);

cout << "Write to spi" << endl;
} else cout << roboio_GetErrMsg();

spi_Close();
SoBot
Robot Builder
Robot Builder
Posts: 17
Joined: Wed Mar 31, 2010 3:10 pm

Post by roboard » Mon Apr 19, 2010 12:00 pm

Post by roboard
Mon Apr 19, 2010 12:00 pm

Hi,

1. we have tried but did NOT see the problem as mentioned, please check if the spi clock pin5 is grounded carelessly.
2. We will add the software similated SPI on future RoBoIO library (V1.6) to tackle the SPI clock speed too high issue.
Hi,

1. we have tried but did NOT see the problem as mentioned, please check if the spi clock pin5 is grounded carelessly.
2. We will add the software similated SPI on future RoBoIO library (V1.6) to tackle the SPI clock speed too high issue.
roboard
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

SPI clock

Post by SoBot » Fri Apr 23, 2010 1:34 pm

Post by SoBot
Fri Apr 23, 2010 1:34 pm

Ok, when will the v1.6 be out? I even tried a nother roboard, but its the same so it must be in the software. I also want to know if it matters that the code is not compiled on the roboard? I compile it on my PC and then send it over the network and run it on the roboard with ssh. (At the moment my roboard runs to slow with Xubuntu to compile it onboard)
Ok, when will the v1.6 be out? I even tried a nother roboard, but its the same so it must be in the software. I also want to know if it matters that the code is not compiled on the roboard? I compile it on my PC and then send it over the network and run it on the roboard with ssh. (At the moment my roboard runs to slow with Xubuntu to compile it onboard)
SoBot
Robot Builder
Robot Builder
Posts: 17
Joined: Wed Mar 31, 2010 3:10 pm

SPI

Post by SoBot » Wed Apr 28, 2010 3:22 pm

Post by SoBot
Wed Apr 28, 2010 3:22 pm

I changed my roboard agian with another one and now it works! Don't know whats wrong with that one. :?
But now I have another problem: My slave device recieves the data but its not very constant. Around 1 out of 5 bytes is an error. Why is it so unstable?
I changed my roboard agian with another one and now it works! Don't know whats wrong with that one. :?
But now I have another problem: My slave device recieves the data but its not very constant. Around 1 out of 5 bytes is an error. Why is it so unstable?
SoBot
Robot Builder
Robot Builder
Posts: 17
Joined: Wed Mar 31, 2010 3:10 pm

Re: SPI

Post by roboard » Thu Apr 29, 2010 4:56 am

Post by roboard
Thu Apr 29, 2010 4:56 am

SoBot wrote:I changed my roboard agian with another one and now it works! Don't know whats wrong with that one. :?
But now I have another problem: My slave device recieves the data but its not very constant. Around 1 out of 5 bytes is an error. Why is it so unstable?


The SPICLK pin of the former RoBoard might be anomalistic; you can contact tech@roboard.com or info@roboard.com for reparing this issue.

The minimum SPI clock of RoBoard is 10MHZ, which may over the spec of your SPI device. This may cause your device receiving data unstably. Please ensure that your device accepts RoBoard's high SPI speed.

PS: RoBoIO v1.6 will add S/W simulated SPI for low-speed SPI devices (< 100KHZ) and will be released in the next week. But, if your device requires a clock speed of > 100KHZ, RoBoIO v1.6 may not be able to solve your problem.
SoBot wrote:I changed my roboard agian with another one and now it works! Don't know whats wrong with that one. :?
But now I have another problem: My slave device recieves the data but its not very constant. Around 1 out of 5 bytes is an error. Why is it so unstable?


The SPICLK pin of the former RoBoard might be anomalistic; you can contact tech@roboard.com or info@roboard.com for reparing this issue.

The minimum SPI clock of RoBoard is 10MHZ, which may over the spec of your SPI device. This may cause your device receiving data unstably. Please ensure that your device accepts RoBoard's high SPI speed.

PS: RoBoIO v1.6 will add S/W simulated SPI for low-speed SPI devices (< 100KHZ) and will be released in the next week. But, if your device requires a clock speed of > 100KHZ, RoBoIO v1.6 may not be able to solve your problem.
roboard
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

SPI

Post by SoBot » Thu Apr 29, 2010 9:05 am

Post by SoBot
Thu Apr 29, 2010 9:05 am

Thanks, I will contact them.

I am using the PIC18F2431 and its running in PLL mode(40 Mhz), that means the SPI should be able to run at max Fosc/4 = 10Mhz. It works great when I use two PIC's running at SPI clock = 10Mhz but not with the roboard and PIC.

Are there any way that I can echo the roboard's SPI data back to the SDI pin to test if the roboard is the problem or not?
Thanks, I will contact them.

I am using the PIC18F2431 and its running in PLL mode(40 Mhz), that means the SPI should be able to run at max Fosc/4 = 10Mhz. It works great when I use two PIC's running at SPI clock = 10Mhz but not with the roboard and PIC.

Are there any way that I can echo the roboard's SPI data back to the SDI pin to test if the roboard is the problem or not?
SoBot
Robot Builder
Robot Builder
Posts: 17
Joined: Wed Mar 31, 2010 3:10 pm

Re: SPI

Post by roboard » Mon May 03, 2010 9:38 am

Post by roboard
Mon May 03, 2010 9:38 am

SoBot wrote:I am using the PIC18F2431 and its running in PLL mode(40 Mhz), that means the SPI should be able to run at max Fosc/4 = 10Mhz. It works great when I use two PIC's running at SPI clock = 10Mhz but not with the roboard and PIC.

Are there any way that I can echo the roboard's SPI data back to the SDI pin to test if the roboard is the problem or not?


The PLL sources of RoBoard's SPI and PIC18F2431's SPI are different, and so the both resulting 10MHZ SPI clocks don't really very match. This may be the reason of unstability. If your PIC18F2431 can run in a faster clock, you should be able to get a more stable SPI transmission with RoBoard.
SoBot wrote:I am using the PIC18F2431 and its running in PLL mode(40 Mhz), that means the SPI should be able to run at max Fosc/4 = 10Mhz. It works great when I use two PIC's running at SPI clock = 10Mhz but not with the roboard and PIC.

Are there any way that I can echo the roboard's SPI data back to the SDI pin to test if the roboard is the problem or not?


The PLL sources of RoBoard's SPI and PIC18F2431's SPI are different, and so the both resulting 10MHZ SPI clocks don't really very match. This may be the reason of unstability. If your PIC18F2431 can run in a faster clock, you should be able to get a more stable SPI transmission with RoBoard.
roboard
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

Post by SoBot » Mon May 10, 2010 3:33 pm

Post by SoBot
Mon May 10, 2010 3:33 pm

Ok, I've got the library v1.6 now and I want to use the spi_InitializeSW function to see if it works with a lower clock speed. But I am not exacly sure how to use the function (there is no documentation availible). What does the SPIMODE's mean. Is the updated documentation still on its way?
Ok, I've got the library v1.6 now and I want to use the spi_InitializeSW function to see if it works with a lower clock speed. But I am not exacly sure how to use the function (there is no documentation availible). What does the SPIMODE's mean. Is the updated documentation still on its way?
SoBot
Robot Builder
Robot Builder
Posts: 17
Joined: Wed Mar 31, 2010 3:10 pm

Post by roboard » Tue May 11, 2010 7:51 am

Post by roboard
Tue May 11, 2010 7:51 am

SoBot wrote:Ok, I've got the library v1.6 now and I want to use the spi_InitializeSW function to see if it works with a lower clock speed. But I am not exacly sure how to use the function (there is no documentation availible). What does the SPIMODE's mean. Is the updated documentation still on its way?


The documents are being prepared (we are writing detailed documents for each sub-lib of RoBoIO). Brief description for new functions of RoBoIO v1.6 and their usage can be found in the "history.txt", in your downloaded files :)
SoBot wrote:Ok, I've got the library v1.6 now and I want to use the spi_InitializeSW function to see if it works with a lower clock speed. But I am not exacly sure how to use the function (there is no documentation availible). What does the SPIMODE's mean. Is the updated documentation still on its way?


The documents are being prepared (we are writing detailed documents for each sub-lib of RoBoIO). Brief description for new functions of RoBoIO v1.6 and their usage can be found in the "history.txt", in your downloaded files :)
roboard
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

SPI

Post by SoBot » Tue May 18, 2010 7:31 pm

Post by SoBot
Tue May 18, 2010 7:31 pm

I think I found my problem. The roboard SPI is at 3.3V and my PIC is running at 5V. I initially thought the PIC's I/O pin min input high voltage is around 2.5V and therefore should work with 3.3 high level. Unfortunately it seems that the pic18f2431 max input high voltage is 3.5V. :(
My PIC can't run on 3.3 volt, so I have to use a level shifter. The bad thing is that my hardware is already made. Does anyone know of a way of doing this without a level shifter? Is it possible to change the roboard's SPI voltage level? (just taking a chance :) )
I think I found my problem. The roboard SPI is at 3.3V and my PIC is running at 5V. I initially thought the PIC's I/O pin min input high voltage is around 2.5V and therefore should work with 3.3 high level. Unfortunately it seems that the pic18f2431 max input high voltage is 3.5V. :(
My PIC can't run on 3.3 volt, so I have to use a level shifter. The bad thing is that my hardware is already made. Does anyone know of a way of doing this without a level shifter? Is it possible to change the roboard's SPI voltage level? (just taking a chance :) )
SoBot
Robot Builder
Robot Builder
Posts: 17
Joined: Wed Mar 31, 2010 3:10 pm

Re: SPI

Post by roboard » Mon May 24, 2010 2:07 am

Post by roboard
Mon May 24, 2010 2:07 am

SoBot wrote:I think I found my problem. The roboard SPI is at 3.3V and my PIC is running at 5V. I initially thought the PIC's I/O pin min input high voltage is around 2.5V and therefore should work with 3.3 high level. Unfortunately it seems that the pic18f2431 max input high voltage is 3.5V. :(
My PIC can't run on 3.3 volt, so I have to use a level shifter. The bad thing is that my hardware is already made. Does anyone know of a way of doing this without a level shifter? Is it possible to change the roboard's SPI voltage level? (just taking a chance :) )


Hi,

indeed, you need a level shifter (composed of a simple transistor circuit or buffer gates) to get 5V RoBoard SPI output. :)
SoBot wrote:I think I found my problem. The roboard SPI is at 3.3V and my PIC is running at 5V. I initially thought the PIC's I/O pin min input high voltage is around 2.5V and therefore should work with 3.3 high level. Unfortunately it seems that the pic18f2431 max input high voltage is 3.5V. :(
My PIC can't run on 3.3 volt, so I have to use a level shifter. The bad thing is that my hardware is already made. Does anyone know of a way of doing this without a level shifter? Is it possible to change the roboard's SPI voltage level? (just taking a chance :) )


Hi,

indeed, you need a level shifter (composed of a simple transistor circuit or buffer gates) to get 5V RoBoard SPI output. :)
roboard
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am


11 postsPage 1 of 1
11 postsPage 1 of 1