SPI

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

SPI

Post by Flouch »

Hello,
I don't understand how work the SPI in flowcode (v5), when i send char like 100,
in the character sent there is no 100 but a d, i really don't understand how work SPI in flowcode.
If someone can help me or give me an example

thanks
Flouch

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: SPI

Post by Enamul »

Hi
You can see the following link to have ides about SPI..
http://www.matrixmultimedia.com/mmforum ... =7&t=11246
Enamul
University of Nottingham
enamul4mm@gmail.com

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

Enamul wrote:Hi
You can see the following link to have ides about SPI..
http://www.matrixmultimedia.com/mmforum ... =7&t=11246
Thanks but this don t help a lot :/

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: SPI

Post by Enamul »

Can you please mention why? In the example flowcode I have used SPI. You can follow that. Or you can post a simple program I will explain..
Enamul
University of Nottingham
enamul4mm@gmail.com

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

Here i don t understand why when i send my variable call test,

test=100 why i got in my SPI char send i got a d ?

e/ thanks again
Attachments
Flowcode1.fcf
(7 KiB) Downloaded 359 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: SPI

Post by Enamul »

Hi,
You have chosen a chip which don't have SPI in it. It will not work in hardware. you have to choose software SPI. to understand how spi works..you can follow following..
http://www.matrixmultimedia.com/mmforum ... =29&t=8645
Enamul
University of Nottingham
enamul4mm@gmail.com

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

ok thanks i have change, but i m always with the same problems, i will read what you have send to me.
But you don't have an example to spi who work ?

if you know a pic who can you SPI, ( i ned SPI to communicate to a rf Transceiver to read different register to know the strength of the signal)
Attachments
Flowcode2.fcf
(7 KiB) Downloaded 333 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: SPI

Post by Enamul »

I don't understand what is actually want to mean by your post. If English is not your first language, you can post in you language..I will translate that. I understand so far from your post that you want to use SPI to access an rf device. That's fine..please post the name and information of that device what you have we can make code for you.
Enamul
University of Nottingham
enamul4mm@gmail.com

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

My rf is http://www.ti.com/lit/ds/symlink/cc2500.pdf and I must read the register to know the strength of the signal.
and i to have choose my pic yet.
But my question is i don't understand how to use SPI in flowcode as you see when i use SPI to send a byte like 100 flow say me "character sent d".

In french

Je ne comprends pas comment utiliser la liaison SPI dans flowcode ( j'ai compris de manière théorique) car lorsque j'envois par exemple 100 flowocode me dis que j'ai envoyer un d, dans mon projet je dois faire la lecture des différents registres de mon transceiver pour connaitre la force de mon signal radio.
De plus je n'ai pas d'idée sur le pic a choisir

thanks again

Dick_Miller_UK
Posts: 13
Joined: Thu Mar 15, 2012 12:14 pm
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: SPI

Post by Dick_Miller_UK »

Flouch,

I am also currently doing some work with SPI in Flowcode and I think I understand your problem. If you right click on the "SPI Legacy" component and then select "Ext Properties" you will get a dialogue box. In the bottom right of the dialogue box you have the option to send either characters or bytes. I believe that yours will be set to characters. If you select bytes then this should solve your problem.

Regards,
Dick Miller

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

Oh thanks was that, you saved my day^^ thanks again to you and enamul for this help.
Enamul if you still want to help me to code this i will accept it ( to coding and the choice of the pic)

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: SPI

Post by Enamul »

Sorry.. I could n't get your point so long that you are struggling in simulation. I wasn't thinking at all about simulation and normally for I2C and SPI I never use simulation as without slave device it is meaningless. I will have a look in the datasheet and post program for you.
Enamul
University of Nottingham
enamul4mm@gmail.com

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

thanks !

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

i don't understand how read the different register to know the strength of the signal of this http://www.farnell.com/datasheets/47796.pdf, and i don't understand what initialized in this component

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: SPI

Post by Enamul »

Hi,
I told you to have a look but this datasheet is too long to follow in short time..
Enamul
University of Nottingham
enamul4mm@gmail.com

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

Enamul wrote:Hi,
I told you to have a look but this datasheet is too long to follow in short time..
hi,
ok sorry thanks again

Flouch
Posts: 29
Joined: Thu Oct 18, 2012 10:19 am
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: SPI

Post by Flouch »

hi, Someone have an idea or know a µc to use SPI ?
thanks

Post Reply