Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Transfering DATA between two pics via SPI OSHONSOFT

Status
Not open for further replies.
I meant, that in testing the SS can be at 0 permanently.
When using multiple SPI devices the Slave has to be setup every time before using it.
 
I meant, that in testing the SS can be at 0 permanently.
When using multiple SPI devices the Slave has to be setup every time before using it.
Hi J,
I've tried all sorts of combinations of SS, but it only seems to work with [ SLAVEpic = 0 ] at the beginning and [ SLAVEpic = 1 ] at the end of the MASTER LOOP, otherwise nothing appears in the analyser.

EDIT: I added a toggling LED in SLAVE MAIN LOOP. This still flashes whether SS is [ 0 ] or [ 1 ] does this seem correct?
EDITEDIT: [ 1 ]
C.
 
Last edited:
Hi J,
I've tried all sorts of combinations of SS, but it only seems to work with [ SLAVEpic = 0 ] at the beginning and [ SLAVEpic = 0 ] at the end of the MASTER LOOP, otherwise nothing appears in the analyser.

EDIT: I added a toggling LED in SLAVE MAIN LOOP. This still flashes whether SS is [ 0 ] or [ 1 ] does this seem correct?
C.
I tried to tell it in #160, #161
What do you see in the analyzer?
Show the main loop.
 
I tried to tell it in #160, #161
What do you see in the analyzer?
Show the main loop.

Hi J,
I followed what you suggested in #160 #161, and set up the best I can, I find it easy to get mixed up, so I'll keep posting the whole programs and results as they change in the hope that you or someone can spot any mistakes. An alternative is that you edit the programs, and I'll test them, where there would be no misinterpretation by me. I don't mind either way.

Here's the 2x programs, and result.
C
 

Attachments

  • 18f4431 8MHz TX SLAVE QEI SPI 220719 1000.bas
    2.9 KB · Views: 334
  • 18F4620 8MHz XTL TX MASTER QEI SPI 220719 1000.bas
    3.2 KB · Views: 310
  • ON no OFF.jpg
    ON no OFF.jpg
    196.3 KB · Views: 334
Hi J,
I've tried all sorts of combinations of SS, but it only seems to work with [ SLAVEpic = 0 ] at the beginning and [ SLAVEpic = 0 ] at the end of the MASTER LOOP, otherwise nothing appears in the analyser.

EDIT: I added a toggling LED in SLAVE MAIN LOOP. This still flashes whether SS is [ 0 ] or [ 1 ] does this seem correct?
C.
So something appeared in the analyzer, what was it?
Now SDI in Master seems to be stuck at 1.
 
So something appeared in the analyzer, what was it?
Now SDI in Master seems to be stuck at 1.
Hi J,
As #163 if there is SS ON in Master with no SS OFF, then it sticks. This is how I interpreted your #161.

If I add OFF back into the MASTER program [ SLAVEpic = 1 ] then it shows [ 255 ]

I've edited an error in #162.
C.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top