SPI help
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
SPI help
I just started the SPI Flowcode and I do not understand how to configure the pins: SCLK, MOSI, MISO, SS. IN fact I only have pins and DAC NVM. My goal is simply to write in registers and read SPI register. If someone has an example
cordially
edit i work on the board EB006 i need other Eblock ?
cordially
edit i work on the board EB006 i need other Eblock ?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Hello,
If you click on View -> Chip in Flowcode then it will provide you with a chip layout.
The SPI component uses the following pins in hardware mode (Flowcode v5).
SCLK - Chip diagram SCK
MOSI - Chip diagram SDO
MISO - Chip diagram SDI
SS - Any free I/O pin.
I would use a LED component or maybe just a output icon set to work in single pin mode to control your slave select output and then the SPI component macros will do all the rest of the work for you.
For software mode (Flowcode v5) you can assign the SPI pins to any general purpose I/O pins.
If you need an example then let me know.
If you click on View -> Chip in Flowcode then it will provide you with a chip layout.
The SPI component uses the following pins in hardware mode (Flowcode v5).
SCLK - Chip diagram SCK
MOSI - Chip diagram SDO
MISO - Chip diagram SDI
SS - Any free I/O pin.
I would use a LED component or maybe just a output icon set to work in single pin mode to control your slave select output and then the SPI component macros will do all the rest of the work for you.
For software mode (Flowcode v5) you can assign the SPI pins to any general purpose I/O pins.
If you need an example then let me know.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
Hello,
Yes I would like an example because I do not understand everything,
My project is to configure a receiver-transmitter (transmitter).
So I have to configure different register (frequency etc) documentation page 58 below.
http://www.ti.com/lit/ds/symlink/cc2500.pdf
And after I have read some register as signal strength.
For this project I have the card EB006, a PIC16F88 or PIC16F874 (I can buy else) and I also have the card with 8 LEDs. (It's first time i use Flowcode and im alone for this project)
thanks for you're time sorry for my english i'm french
Yes I would like an example because I do not understand everything,
My project is to configure a receiver-transmitter (transmitter).
So I have to configure different register (frequency etc) documentation page 58 below.
http://www.ti.com/lit/ds/symlink/cc2500.pdf
And after I have read some register as signal strength.
For this project I have the card EB006, a PIC16F88 or PIC16F874 (I can buy else) and I also have the card with 8 LEDs. (It's first time i use Flowcode and im alone for this project)
thanks for you're time sorry for my english i'm french
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Hello,
Your English is great, please could you tell me which version of Flowcode your using?
Your English is great, please could you tell me which version of Flowcode your using?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
thanksBenj wrote:Hello,
Your English is great, please could you tell me which version of Flowcode your using?
flowcode student version V5.4.0.0
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Hello,
Sorry but the Student / Home version doesn't support the SPI component. Only the Pro or Site license versions will allow you to compile code for this component and the other advanced components.
Sorry but the Student / Home version doesn't support the SPI component. Only the Pro or Site license versions will allow you to compile code for this component and the other advanced components.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
hmm strange i can use SPI in my student version, Can iupdate to the pro version ?Benj wrote:Hello,
Sorry but the Student / Home version doesn't support the SPI component. Only the Pro or Site license versions will allow you to compile code for this component and the other advanced components.
in not student but home version
hmm i just watch on the website i can update for only 25 pounds ? if is right i can do this
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Hello,
The SPI component will simulate but when you go to compile to C code the C functions will be missing.
You can upgrade a home license to a pro license by simply paying the difference between the versions. You can do all this via the form on the main Flowcode page.
http://www.matrixmultimedia.com/product ... rm&Var=PIC
The SPI component will simulate but when you go to compile to C code the C functions will be missing.
You can upgrade a home license to a pro license by simply paying the difference between the versions. You can do all this via the form on the main Flowcode page.
http://www.matrixmultimedia.com/product ... rm&Var=PIC
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
Ok no problem then i will do for 150 pounds. where i can find discount code ^^ .?Benj wrote:Hello,
The SPI component will simulate but when you go to compile to C code the C functions will be missing.
You can upgrade a home license to a pro license by simply paying the difference between the versions. You can do all this via the form on the main Flowcode page.
http://www.matrixmultimedia.com/product ... rm&Var=PIC
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Hello,
You simply pop in you old license key when buying the new version and it should work out the correct discount for you.
Let me know and I will put the example together for you.
You simply pop in you old license key when buying the new version and it should work out the correct discount for you.
Let me know and I will put the example together for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
i have already done i just uninstal my home version ! now i have the tools.Benj wrote:Hello,
You simply pop in you old license key when buying the new version and it should work out the correct discount for you.
Let me know and I will put the example together for you.
i'm ready
thanks again to take times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Here is a basic example to read an 8-bit DAC.
- Attachments
-
- SPI.fcf
- (14.5 KiB) Downloaded 448 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
so with this example i get a char ( so 1byte) and the led is to select the slave right ?Benj wrote:Here is a basic example to read an 8-bit DAC.
how the slave can know witch register i want to read ?
and i have two pin for the SPI : DAC pin and NVM pin it's like MOSI ans MISO ?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Hello,
Yes the LED component is controlling the slave select pin.
The DAC and NVM pins are slave select pins to be used with the DAC and NVM related functions. It's basically an E-block thing and you can ignore these pin connections.
In hardware mode the connections are specified by the chip, the pins are marked on the chip diagram.
In software mode the SPI pins will appear in the connections manager so you can assign them to which ever pin you like.
Hardware / Software mode is selected by going into the EXT_Properties of the SPI component.
For a module like a memory device there should be a datasheet that details the method to read a specific address. My guess is it is something like this.
Enable slave select (switch off LED)
send command byte to read an address (SPI_Send_Char)
send address byte(s) (SPI_Send_Char)
receive the data byte (SPI_Get_Char)
disable the slave select (switch on LED)
For a generic 8-bit DAC you only ever read one address so the code is much simpler.
Enable slave select (switch off LED)
receive the data byte (SPI_Get_Char)
disable the slave select (switch on LED)
Yes the LED component is controlling the slave select pin.
The DAC and NVM pins are slave select pins to be used with the DAC and NVM related functions. It's basically an E-block thing and you can ignore these pin connections.
In hardware mode the connections are specified by the chip, the pins are marked on the chip diagram.
The slave select (SS) pin is specified by the LED component connections.SCLK - Chip diagram SCK
MOSI - Chip diagram SDO
MISO - Chip diagram SDI
In software mode the SPI pins will appear in the connections manager so you can assign them to which ever pin you like.
Hardware / Software mode is selected by going into the EXT_Properties of the SPI component.
For a module like a memory device there should be a datasheet that details the method to read a specific address. My guess is it is something like this.
Enable slave select (switch off LED)
send command byte to read an address (SPI_Send_Char)
send address byte(s) (SPI_Send_Char)
receive the data byte (SPI_Get_Char)
disable the slave select (switch on LED)
For a generic 8-bit DAC you only ever read one address so the code is much simpler.
Enable slave select (switch off LED)
receive the data byte (SPI_Get_Char)
disable the slave select (switch on LED)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
ok so i have understand how to read a register : 1 enable communcation (SS), send witch register we want to read 1byte and finally receive the information in 1 byte.
and i guess to write something in register we do the same like : enable commucation (ss) and we send two byte : 1 for the register other for the information right ?
Thanks you for the tips for the software mode so i don't care about DAC and NVM ?
sorry for so much questions
and i guess to write something in register we do the same like : enable commucation (ss) and we send two byte : 1 for the register other for the information right ?
Thanks you for the tips for the software mode so i don't care about DAC and NVM ?
sorry for so much questions
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Ive had a quick look at the datasheet and here is a quick example to read and write registers.
- Attachments
-
- SPI-2.fcf
- (13.45 KiB) Downloaded 323 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI help
Yep DAC and NVM pins can be ignored and the software mode allows for easy configuration.
Let me know how you get on.
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
what do you think of the program bellow ? write something with SPI and read the information
- Attachments
-
- Flowcode1.fcf
- (11.34 KiB) Downloaded 300 times
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
thanks, but i think i got a problem in the board i had develop to isolate the 3.6V and the 5V...Enamul wrote:That seems fine.
- 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 help
Can you please tell what the problem is?i think i got a problem in the board i had develop to isolate the 3.6V and the 5V...
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
i think i have a problem with my schematicEnamul wrote:Can you please tell what the problem is?i think i got a problem in the board i had develop to isolate the 3.6V and the 5V...
http://i46.tinypic.com/2j4x53t.png
maybe is not good or my resistance pull-up to low (2Kohms) when i just plut my board to the led all the led are light i don't know why
- 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 help
You can try with 4.7K pull up resistor.maybe is not good or my resistance pull-up to low (2Kohms)
- 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 help
Hi
Another issue you can check..idle state of the clock pulse (SCK) and in which edge clock works. Sometimes in SPI it causes the problem. You will get those information in the property of the component.
Another issue you can check..idle state of the clock pulse (SCK) and in which edge clock works. Sometimes in SPI it causes the problem. You will get those information in the property of the component.
-
- Posts: 29
- Joined: Thu Oct 18, 2012 10:19 am
- Has thanked: 6 times
- Been thanked: 1 time
- Contact:
Re: SPI help
I am looking if the clocks are synchronized (same frequency)?Enamul wrote:Hi
Another issue you can check..idle state of the clock pulse (SCK) and in which edge clock works. Sometimes in SPI it causes the problem. You will get those information in the property of the component.
thanks again for help me but at this time i don't know if it's my program of my board...
Last edited by Flouch on Sat Dec 01, 2012 11:41 am, edited 1 time in total.