LPC1114 SPI multiple devices sharing bus

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1114 SPI multiple devices sharing bus

1,633 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zzz on Sat Sep 17 13:35:27 MST 2011
Hi Everyone,
I have finally tweaked the SSP example to work for my MAX6675 Thermocouple to SPI converter. I am currently using USE_CS = 1 on port 2 so Pin 2_0 is the SSEL.

Now I would like to add a second MAX6675 to the same SSP1 bus. I know this is done with another GPIO as the CS. I want to make it as seamless as the SSEL pin. Is there a way to do this by modifying the SSP_IOConfig()?  Looking through the code I dont see it toggling Pin 2_0, is this done internally?

The simplest solution is to just add a multiplexer but i would like to avoid extra ic's.

In the future I plan on adding a third MAX6675 and/or other spi devices on the same bus.
0 Kudos
Reply
8 Replies

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MindBender on Fri Jul 31 07:11:44 MST 2015

Quote: zzz
Now I would like to add a second MAX6675 to the same SSP1 bus. I know this is done with another GPIO as the CS. I want to make it as seamless as the SSEL pin.


For the second CS, you could choose a pin on which you can multiplex SSEL too. In that case, switching between devices is a simple as swapping pin functions.
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by axelmoranelli87 on Fri Jul 31 05:46:23 MST 2015
Hi, Please could you send me the code you used to handle the MAX6675 with the LPC1769 SSP ?? thanks
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zzz on Sun Sep 18 18:03:02 MST 2011
:cool: oooh fancy, platinum! I was looking at those, so they are slow hmm. The thermocouple is pretty fast and 5$ for the fancy one and 2x 3$ for just the solder blob on a braided wire. Its a little slower for sudden changes, like room temp to glass of ice water ~45-60s, but in a reflow oven it should be good. I'll let you know when I do my first QFN.
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Sep 18 17:43:01 MST 2011
Thanks for your info :)

At the moment i'm using a wonderful PT1000 stainless steel sensor (0-700°C) to measure 0-300°C.

But it's a little bit slow and so i'm thinking about trying a thermocouple solution...

BTW: I've used an 1N4148 with ATMega for my first reflow oven.
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zzz on Sun Sep 18 17:05:12 MST 2011
I am making a solder reflow oven for my lab.


Quote:
#1 Which thermocouple are you using?



I am using cheapo type K thermocouples from Ebay


Quote:
#2 Which temperature range are you measuring?



Room temperature to about 400C, I wish I could just do it with PN junction measurement but that's only good to about 125C(150C?).


Quote:
#3 MAX6675 isn't really cheap, do you think it's worth the money?



Not only is the MAX6675 not cheap, its now not recomended for new designs :mad: apparently some time in the summer it became obsolete. MAX31855 is the replacement part with an extra 2 bits and now -ve temperature readings.

If this was a production item I would not use the MAX6675 @ over 7$ea  :eek: the ones i had in stock where from some free samples. The replacement MAX31855 is a more reasonable ~$3ea.

Anyways its just one oven. If I get in the oven business, I'll just use the cheaper chip or equivalent ones from other manufactures.

Thanks,
Jon

P.S. If you want MAX31855 ready code i'll send you my 6675 code and you can modify it or maybe by then I would have already done that.
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Sep 18 16:27:45 MST 2011
Could you please tell me a few things about your project :)

#1 Which thermocouple are you using?

#2 Which temperature range are you measuring?

#3 MAX6675 isn't really cheap, do you think it's worth the money?
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zzz on Sun Sep 18 15:34:16 MST 2011
Ah too bad, I wanted a nice elegant solution, using GPIO instead of SSEL worked out fine. Just not as pretty on when looking at the waveform on the scope.


Thanks again Zero, you are the one man hero of this forum. I hope NXP is sending you checks in the mail for all the work you do here. :D

-Jon

P.S. If anyone needs to use a MAX6675 I did all the hard work, now you can implement using a function call and editing a few #defines.
0 Kudos
Reply

1,579 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Sep 17 14:08:24 MST 2011
With USE_CS=1 SSEL is controlled by SPI/SSP controller :eek:

This is done with IOCON setting:

LPC_IOCON->PIO2_0 &= ~0x07;   
LPC_IOCON->PIO2_0 |= 0x02;        /* SSP SSEL */

Just use a GPIO with USE_CS=0 to select your chip(s) :)
0 Kudos
Reply