• AVR Freaks

Helpful ReplyHot!Harmony 2.03b I2C issue PICMZ - Silicon Errata

Page: < 123 Showing page 3 of 3
Author
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/20 07:45:22 (permalink)
0
Just tested PIC32MZ2048EFM100 Rev. A3 and problem has not been solved in this silicon revision. 
Can't say that this issue is less frequent in A3 than in A1, but still happens.
 
Don't know what to do to go ahead now.
Need to modify I2C driver by myself at this point. 
 
Really frustrated and nervous today!!!!
 
 
#41
NKurzman
A Guy on the Net
  • Total Posts : 18033
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/20 08:16:27 (permalink)
4 (1)
If the Hardware I2C does not work in your Application then Bit Bang it.  If you are using the Harmony driver it may have that option.
#42
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/20 17:52:48 (permalink)
4 (2)
Just tryed to bit bang. I'm running PIC32MZ EF at 50Mhz and at this clock speed the bit banged driver introduces to much overhead and jitter in some other time critical tasks since it used a system timer in interrupt mode.
 
The error in I2C does not happens so frequently (once every hour or 2 hours). I think this issue should be solved by Microchip at driver level (non blocking BusClear function + timer supervisor) as proposed by Gary in a previous post.
 
Furthermore I2C Driver is still in alpha after 3 years or more.. I really don't understand why Microchip decided not to invest in this peripheral and his driver within Harmony.
#43
NKurzman
A Guy on the Net
  • Total Posts : 18033
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/20 19:38:13 (permalink)
0
You can use the MIPS core timer for timing.
 
example:
 
#define BAUD_RATE_I2C 100000UL // Baud rate
#define BRG_TIME_I2C ((SYS_CLK_FREQ / 2)/(BAUD_RATE_I2C * 2)) // For a Core Timer Delay
 
static void i2cBitDelay(void)
{
   uint32_t startTime;
   startTime = _CP0_GET_COUNT(); // Read the Core Timer
   while ((_CP0_GET_COUNT() - startTime) < BRG_TIME_I2C); // wait for timer to expire
}
time Critical Tasks in the Main Loop?
If that is the case them you would need insure you did not wait too long  reading.  You would need a state machine.
 
You can use a static Version of the Harmony Driver and fix it as you see fit, if their H/W version works better for you.
 
You can also write your Own Hardware version that handles the Errata, and recovers the I2C. Like in the old days before Harmony.
 
 
 
#44
Mysil
Super Member
  • Total Posts : 3469
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: online
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/20 19:52:47 (permalink)
0
Hi,
I do not think there is a concious decision to not pay attention to the I2C driver in Harmony.
My impression is more that I2C end up in the bottom of the "ToDo Pile".
 
So, while Harmony development, barely have head above the water w.r.t Graphics Development and drivers for graphic Controllers, Wi-Fi driver development, and Filesystem support, I am not much surprised.
 
I2C is in many ways regarded as a simple task to handle, and while this is true for many simple applications,
a I2C driver in a interrupt implementation, is a part of a communication stack that share several properties with a TCP/IP or a USB communication stack, and those have received many years of development work.
 
Then, hardware malfunctions in PIC32MZ devices, and work-arounds that have been put in there, may have consumed those resources that were available.
 
If the I2C driver is expected to work reliably in a unreliable environment.
Meaning where Hot-plugging of I2C devices, or other events may cause Bus collision or loss of communication, in addition to possibility for Lost Arbitration in Multimaster I2C operations, may happen.
Then those precautions mentioned above:
Non blocking BusClear function + timer supervisor, may be needed anyway.
 
Similarly, the Microchip Code Configurator project also have a big backlog. There are a number of dsPIC devices with complex Motor Control  peripherals, that are not supported yet.
 
I have spent about a year studying and rewriting the I2C driver provided by MCC, into a consistent set of drivers for PIC16, PIC18, PIC24, PIC32MM and and PIC32MX, and is not yet finished.
Some results so far, are contributed in the MCC forum.
They use driver interface functions based on MCC driver, with extensions, so are distinctly different from Harmony driver interface.
In the meantime, MCC project have started their own development of a new set of drivers, in connection with development of example code for Mikro Elektronika Click devices.
 
I had no intention of getting involved with MZ or Harmony, until my current development is more stable, but maybe within another year?
 
   Mysil
#45
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/21 02:17:44 (permalink)
4.5 (2)
I've developed my state machine (non blocking), queue buffered, multi client I2C driver for PIC24F, dsPIC and it works great. Never had a issue in production since 5 years or more.
 
Now I'm using PIC32MZ EF I2C Dynamic Driver, and look pretty good on the paper. It allows non blocking, queue buffered multi client operations, that allows me to handle multiple I2C sensors and pheripherals on the sam BUS from different APPS, with the possibility to queue I2C operations. This looks fantastic, but I2C Errata makes all these features unusable. But this problem goes beyond Errrata, since a roubust and reliable I2C driver should be able to manage errors also (bus collision, overrun, state machine blocking), since these can be caused by EMI or other external causes. I'm not talking about hot plugging I2C at this time, even though also this scenario should be considered for a perfect I2C driver.
 
I'm using the I2C driver exploiting all it's capabilities, and now this translates into a big issue for me. The whole application is almost complete and my product is going in mass production (first batch is already out with I2C issues).
 
I'm blocked and cannot go ahead, my only option is work on existing I2C driver in order to fix this issue (non blocking BusClear function + timer supervisor). I can do it, but I think that this is a Microchip problem and a task that should be managed by Microchip team.
 
I2C driver is still in Alpha (I think that is one of the few peropherel driver still remaining in this state), while Harmony 2.03b is approaching to be in production from beta (2.03b -> 2.04).
 
We are Microchip design partner since 2005, and recently we have some problems also with customers trying to justify that simple things are not working... I think that Microchip should seriously think about his relationship with customers, and not only on profit.. "customers first" was one of the principles of Microchip since some time ago.. what about now?
#46
NKurzman
A Guy on the Net
  • Total Posts : 18033
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/21 06:06:37 (permalink)
0
Why can you port your pic24 I2c code to the PIC32? They are very similar.
#47
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/21 16:33:29 (permalink)
4.67 (3)
NKurzman
Why can you port your pic24 I2c code to the PIC32? They are very similar.



1) My issue is not strictly related to I2C driver itself but mainly depends on I2C Errata.
2) Harmony I2C driver is working fine, but should be able to handle PIC32MZ I2C Errata in my opinion. Harmony doesn't make sense without basic drivers.
#48
NKurzman
A Guy on the Net
  • Total Posts : 18033
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/21 16:41:21 (permalink)
3 (1)
Johnny0099
NKurzman
Why can you port your pic24 I2c code to the PIC32? They are very similar.



1) My issue is not strictly related to I2C driver itself but mainly depends on I2C Errata.
2) Harmony I2C driver is working fine, but should be able to handle PIC32MZ I2C Errata in my opinion. Harmony doesn't make sense without basic drivers.


A reasonable assumption.  But since it does not, are you going to make it work?
#49
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/22 14:45:24 (permalink)
5 (1)
I've already spent most of my time in this project by fixing Harmony driver issues.. just a little bit tired and disappointed. But even more disappointed about the fact that PIC32MZ EF is still buggy on I2C after Rev A0, A1, A2, A3, B0 and B1.
 
I will make it work or probably Microchip will make it work, but please, let me be polemic almost until this problem is not solved. I'm a Microchip design partner and I love Harmony.. so I want to see my project working 100% with Harmony drivers.
#50
NKurzman
A Guy on the Net
  • Total Posts : 18033
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2017/06/22 15:00:24 (permalink)
4.33 (3)
Bring it up with you F.A.E. or who ever Microchip design partners go to.
The Forum is not the Place for official complaints.
Did you get any posts from the Harmony Team?
#51
Stri
Super Member
  • Total Posts : 191
  • Reward points : 0
  • Joined: 2008/03/24 04:10:00
  • Location: Russia, Nsk
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2019/05/06 01:28:24 (permalink)
0
So, this problem is solved in harmony v 2.06 or not? I had i2c lock-up while unintentionally written too many bites into slave, but this DRV_I2C_Bus_Clear() seems to clear this error without any problem...

Let's telegram! t.me/microchip_forum
#52
Paul PortSol
Super Member
  • Total Posts : 530
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2019/05/06 04:28:45 (permalink)
0
PIC32MZ I2C issue is in Hardware Errata, it isn't a Harmony issue. Harmony offers the "bitbang" as a patch to bypass hardware bug, but I haven't seen any cure that allows reliably using Hardware I2C in PIC32MZ.
#53
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
Re: Harmony 2.03b I2C issue PICMZ - Silicon Errata 2019/05/07 08:27:45 (permalink)
0
 
Silicon revision B2 solves most of hardware issues, but i'm still having some problems with the driver (not sure if a hardware or harmony issue), that makes the uC to reset. Apparently it's a PLIB issue.
 
It's almost 2 years and no solution. I've opened a ticket recently, but it seems that i'm loosing my time.
 

 

Attached Image(s)

#54
Page: < 123 Showing page 3 of 3
Jump to:
© 2019 APG vNext Commercial Version 4.5