View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19224
|
|
Posted: Wed Feb 13, 2019 9:40 am |
|
|
Your link refused to work.
The board has an LDO regulator for going from 5v (since this is what the
Arduino provides by default), so one has to assume he is running at
probably 5v. You can run the board off 3.3v, and then the LDO is nearly
a short and the chip runs only a few tenths of a volt below the rail.
Not really ideal.
As you say he has never given the voltage, but assuming he is running
at 5v, the data will not reliably be read unless he switches to using
the SMBUS levels. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9111 Location: Greensville,Ontario
|
|
Posted: Wed Feb 13, 2019 10:20 am |
|
|
There's no mention as to which LDO 3 v reg is on that board BUT it might be possible to run the PIC from the module. I'd remove the onboard LED as he has an LCD module..ooops... THAT may be why the 5 volt supply...now he could use a dickson doubler and be 100% 3 volt....
though SMbus mode seems the easiest solution.
Jay |
|
|
rfjhh
Joined: 31 Mar 2011 Posts: 51 Location: Mexico
|
It works!!!!!!!! |
Posted: Thu Feb 14, 2019 8:30 am |
|
|
PCM programmer
Thanks, your example works well.
At first glance it seems to be the same as what I do, but I think there is some detail to discover.
I think I'll learn a lot by analyzing this code.
Thanks a lot
By the way
PIC VDD = 5V |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9111 Location: Greensville,Ontario
|
|
Posted: Thu Feb 14, 2019 9:10 am |
|
|
It works because it changes the HARDWARE within the PIC to alter the thresholds of what will be considered to be a '1'.
You should read the PIC datasheet (electriclal and MSSP sections) very carefully.
The actual 'I2C' driver code is not what has made it worked.
Whenever interfacing 3 volt peripherals (the 'normal' these days) to PICs with a Vdd of 5 volts, you WILL run into this problem. That's why we all suggest either using a 3 volt rated or 'logic level converters' so that the proper '1's and '0's can be sent and read. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19224
|
|
Posted: Thu Feb 14, 2019 9:15 am |
|
|
You are sending the register address before the device address. The device address _must_ be the first byte after the 'start'.
I'd be very surprised if you are getting reasonable values, since the chip
should not be able to give enough voltage to drive your PIC.
If it is working, I wonder if the internal pull-ups are actually to 5v. If so the
chip will be being 'overdriven' when data is written, but it might (just) allow
it to work. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9111 Location: Greensville,Ontario
|
|
Posted: Thu Feb 14, 2019 10:12 am |
|
|
I made the assumption he's got PCM Ps 'SMBUS' in the I2C options.... though it'd be nice to see the current code.
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19224
|
|
Posted: Thu Feb 14, 2019 12:17 pm |
|
|
Problem is I checked the data sheet, and the 877 he is using doesn't offer
the SMBUS option. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9111 Location: Greensville,Ontario
|
|
Posted: Thu Feb 14, 2019 12:42 pm |
|
|
well you got me thinking,cause that chip is kinda old,like me.. so I looked at my copy ..877c,
DS30292C-page 155... there IS a D044A parameter ! SMBUS
Mind you whether the compiler understands it, is another question.
He may be just lucky, VDD <5 by a little, Vgyro>3.5 a little and it's JUST seeing a '1' , once in awhile...
If I had time, I'd cut/compile/test but currently translating 30 year old BASIC52 code into CCS C. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19224
|
|
Posted: Thu Feb 14, 2019 1:52 pm |
|
|
DS30292C is for the 87x, not the 887. 41291d is the current datasheet from
MicroChip, for the 887. no mention of SMBUS anywhere. Unusual, since
most chips do offer this. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9111 Location: Greensville,Ontario
|
|
Posted: Thu Feb 14, 2019 3:01 pm |
|
|
dang,..getting old sucks..NOW I'm dislexic ! Bad enough I can't type, now numbers get reversed as well....
wonder what comes next ?
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19224
|
|
Posted: Fri Feb 15, 2019 1:53 am |
|
|
I read it as 877 the first time I looked at the code.....
Reason is simple. The 877 is so common compared to the 887. Was
surprised to see this later chip being used. |
|
|
|