EmbeddedRelated.com
Forums

Need help interfacing MCP42010 with Pic16f628

Started by smitty505000 December 27, 2005
Hey all,

Need some help in my latest endever. I am trying to drive a
MCP42010 digital pot with a Pic16f628. I have read all the data sheets
and still stumped. SPI on the MCP42010 uses CS(chip select), SCK
(serial clock), and SI(serial date input). Which pins corospond to
these on the PIC? Is it right in front of me?? LOL

Thanks,
Smitty




Well, I just checked the datasheet and I don't see a SSP or MSSP
device, so built-in SPI doesn't exist. You can do a search for 'SPI'
in the document to see what doesn't come up.

So, since you like the 18 pin package, you'll just love the 16F88.
More gadgets including the desirable SSP device. This is my new,
favorite, device. I particularly like the internal 8 MHz RC
oscillator. If I don't need speed, I don't have to use pins for an
external crystal. I can't speak highly enough of this device.

Now, if you don't want to change devices, you can always bit-bang SPI
using 3 IO pins. Check www.piclist.com for example code (I
think...). Anyway, it's pretty easy.

Even with the SSP device, you will still have to deal with CS' by
either grounding it permanently (if you only have one device on the
bus) or by using an output bit (recommended).

Richard

--- In piclist@picl..., "smitty505000" <smitty505000@y...>
wrote:
>
> Hey all,
>
> Need some help in my latest endever. I am trying to drive a
> MCP42010 digital pot with a Pic16f628. I have read all the data
sheets
> and still stumped. SPI on the MCP42010 uses CS(chip select), SCK
> (serial clock), and SI(serial date input). Which pins corospond to
> these on the PIC? Is it right in front of me?? LOL
>
> Thanks,
> Smitty
>




Much Thanks Richard!
I am now going in the right direction! LOL. I think I am going to
try the Bit banging road. I have not been able to find any sample
code to study for Picbasic PRO. Any ideas where I can find some?
This is my first attempt at connecting to another device.

Thanks,
Smitty --- In piclist@picl..., "rtstofer" <rstofer@p...> wrote:
>
>
> Well, I just checked the datasheet and I don't see a SSP or MSSP
> device, so built-in SPI doesn't exist. You can do a search
for 'SPI'
> in the document to see what doesn't come up.
>
> So, since you like the 18 pin package, you'll just love the
16F88.
> More gadgets including the desirable SSP device. This is my new,
> favorite, device. I particularly like the internal 8 MHz RC
> oscillator. If I don't need speed, I don't have to use pins for
an
> external crystal. I can't speak highly enough of this device.
>
> Now, if you don't want to change devices, you can always bit-bang
SPI
> using 3 IO pins. Check www.piclist.com for example code (I
> think...). Anyway, it's pretty easy.
>
> Even with the SSP device, you will still have to deal with CS' by
> either grounding it permanently (if you only have one device on
the
> bus) or by using an output bit (recommended).
>
> Richard
>
> --- In piclist@picl..., "smitty505000" <smitty505000@y...>
> wrote:
> >
> > Hey all,
> >
> > Need some help in my latest endever. I am trying to drive a
> > MCP42010 digital pot with a Pic16f628. I have read all the data
> sheets
> > and still stumped. SPI on the MCP42010 uses CS(chip select), SCK
> > (serial clock), and SI(serial date input). Which pins corospond
to
> > these on the PIC? Is it right in front of me?? LOL
> >
> > Thanks,
> > Smitty
> >
>




--- In piclist@picl..., "smitty505000" <smitty505000@y...>
wrote:
>
> Much Thanks Richard!
> I am now going in the right direction! LOL. I think I am going to
> try the Bit banging road. I have not been able to find any sample
> code to study for Picbasic PRO. Any ideas where I can find some?
> This is my first attempt at connecting to another device.
>
> Thanks,
> Smitty

That's an entirely different question. You don't need to worry
about the hardware, just look at the ShiftIn and ShiftOut commands
and see if they'll work.

Otherwise, look at the timing diagram for the device and notice how
the clock and data lines toggle. Then make some output bits do the
same thing.

But, I think PicBasic PRO will do it for you.

Richard


Is that a digital pot ? looks familiar.
If so I think I have code somewhere. It does work with shiftout.
Jim
----- Original Message -----
From: rtstofer
To: p...@yahoogroups.com
Sent: Wednesday, December 28, 2005 6:33 PM
Subject: [piclist] Re: Need help interfacing MCP42010 with Pic16f628

--- In p...@yahoogroups.com, "smitty505000" <smitty505000@y...>
wrote:
>
> Much Thanks Richard!
> I am now going in the right direction! LOL. I think I am going to
> try the Bit banging road. I have not been able to find any sample
> code to study for Picbasic PRO. Any ideas where I can find some?
> This is my first attempt at connecting to another device.
>
> Thanks,
> Smitty

That's an entirely different question.  You don't need to worry
about the hardware, just look at the ShiftIn and ShiftOut commands
and see if they'll work.

Otherwise, look at the timing diagram for the device and notice how
the clock and data lines toggle.  Then make some output bits do the
same thing.

But, I think PicBasic PRO will do it for you.

Richard


Richard,

Sounds good. Ill play around with it and see what I can do.

Thanks!
Smitty

--- In piclist@picl..., "rtstofer" <rstofer@p...> wrote:
>
> --- In piclist@picl..., "smitty505000" <smitty505000@y...>
> wrote:
> >
> > Much Thanks Richard!
> > I am now going in the right direction! LOL. I think I am going
to
> > try the Bit banging road. I have not been able to find any
sample
> > code to study for Picbasic PRO. Any ideas where I can find some?
> > This is my first attempt at connecting to another device.
> >
> > Thanks,
> > Smitty
>
> That's an entirely different question. You don't need to worry
> about the hardware, just look at the ShiftIn and ShiftOut commands
> and see if they'll work.
>
> Otherwise, look at the timing diagram for the device and notice
how
> the clock and data lines toggle. Then make some output bits do
the
> same thing.
>
> But, I think PicBasic PRO will do it for you.
>
> Richard
>




Yup, a digital pot. Some code would be awesome!

Thanks for the reply!
Smitty

--- In piclist@picl..., "JCullins" <james_cullins@s...>
wrote:
>
> Is that a digital pot ? looks familiar.
> If so I think I have code somewhere. It does work with shiftout.
> Jim
> ----- Original Message -----
> From: rtstofer
> To: piclist@picl...
> Sent: Wednesday, December 28, 2005 6:33 PM
> Subject: [piclist] Re: Need help interfacing MCP42010 with
Pic16f628
>
>
> --- In piclist@picl..., "smitty505000"
<smitty505000@y...>
> wrote:
> >
> > Much Thanks Richard!
> > I am now going in the right direction! LOL. I think I am going
to
> > try the Bit banging road. I have not been able to find any
sample
> > code to study for Picbasic PRO. Any ideas where I can find
some?
> > This is my first attempt at connecting to another device.
> >
> > Thanks,
> > Smitty
>
> That's an entirely different question. You don't need to worry
> about the hardware, just look at the ShiftIn and ShiftOut
commands
> and see if they'll work.
>
> Otherwise, look at the timing diagram for the device and notice
how
> the clock and data lines toggle. Then make some output bits do
the
> same thing.
>
> But, I think PicBasic PRO will do it for you.
>
> Richard >
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions
> -------------------------------
-----------
> YAHOO! GROUPS LINKS
>
> a.. > -------------------------------
-----------
>




I will see what I can find for you.
You need to contact me off list and I will send it.
I have a funeral to go to tomorrow so it may be late before I respond.
Jim
----- Original Message -----
From: smitty505000
To: p...@yahoogroups.com
Sent: Wednesday, December 28, 2005 7:00 PM
Subject: [piclist] Re: Need help interfacing MCP42010 with Pic16f628

Yup, a digital pot. Some code would be awesome!

Thanks for the reply!
Smitty

--- In p...@yahoogroups.com, "JCullins" <james_cullins@s...>
wrote:
>
> Is that a digital pot ? looks familiar.
> If so I think I have code somewhere. It does work with shiftout.
> Jim
>   ----- Original Message -----
>   From: rtstofer
>   To: p...@yahoogroups.com
>   Sent: Wednesday, December 28, 2005 6:33 PM
>   Subject: [piclist] Re: Need help interfacing MCP42010 with
Pic16f628>   --- In p...@yahoogroups.com, "smitty505000"
<smitty505000@y...>
>   wrote:
>   >
>   > Much Thanks Richard!
>   > I am now going in the right direction! LOL. I think I am going
to
>   > try the Bit banging road. I have not been able to find any
sample
>   > code to study for Picbasic PRO. Any ideas where I can find
some?
>   > This is my first attempt at connecting to another device.
>   >
>   > Thanks,
>   > Smitty
>
>   That's an entirely different question.  You don't need to worry
>   about the hardware, just look at the ShiftIn and ShiftOut
commands
>   and see if they'll work.
>
>   Otherwise, look at the timing diagram for the device and notice
how
>   the clock and data lines toggle.  Then make some output bits do
the
>   same thing.
>
>   But, I think PicBasic PRO will do it for you.
>
>   Richard>
>
>   to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions>
> -------------------------------
-----------
>   YAHOO! GROUPS LINKS
>
>     a..  > -------------------------------
-----------