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.

18LF4620 MASTER 18F4431 MASTER/SLAVE

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
Good news! A friend of mine has agreed to help me with my project, which uses SPI for communication between PICS and peripherals/SLAVES.

Note: here is a previous post, that I didn't manage to clear up: https://www.electro-tech-online.com...ween-two-pics-via-spi-oshonsoft.155857/page-9

My quesion is: Can one PIC be MASTER to peripherals, such as 'barometer module', plus a second PIC as SLAVE. This second PIC starts in SLAVE MODE then switches to MASTER to a compass module, all on the same SPI bus? The idea is for the second PIC to READ the compass, then send its DATA to the MASTER.
Cheers, Camerart
 
Last edited:
You're using an 18 series which can easily do the required calculations. Why complicate matters?

Mike.
 
Of course it can. What else has your "Master" chip got to do?

Mike.
Hi M,
To clarify, PIC1 can always be MASTER while PIC2 can switch between MASTER (Not MASTER to PIC1) and SLAVE, is this correct.

PIC1, what you are calling MASTER, is getting full and the calculation that I hope PIC2 to do is slowing the PIC1 process.
C
 
With that chip you should be running at 32MHz and have 64k of program memory. How can you be stuggeling with that?

Mike.
 
With that chip you should be running at 32MHz and have 64k of program memory. How can you be stuggeling with that?

Mike.
Hi M,
I'm trying to get information to assist my friend, who will set things accordingly, so he may not struggle, but you didn't clarify my #7 question.
C.
 
Hi,
From my friends explanation, he's hoping to have 1/PIC as MASTER and 2/PIC as SLAVE, then use a ring buffer to talk to the peripherals.
I've got no experience of this although I've read quite a bit about them, so see what happens.
C
 
I'm with the rest, it sounds like you're lookling for a very complicated and difficult solution to a simple problem? - however, I suggest you research 'multi-master' if you want to make life difficult for yourself.
 
I'm with the rest, it sounds like you're lookling for a very complicated and difficult solution to a simple problem? - however, I suggest you research 'multi-master' if you want to make life difficult for yourself.
Hi M,
I never want to make myself more difficult, but I've had the update PIC 1 over the years since this project started longer than I can remember ago. The latest 18LF4620's memory started to get full, and there's a lot more to do, so I thought I'd use the second almost empty PIC as an overflow, where what maybe a time consuming process can be done separately. Basically, I'm trying to future proof things.

I'll look up 'multi master' although my mate has taken over the design, so he'll tell me what I have to do at each step.
Thanks.
C.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top