• AVR Freaks

Hot!SPI configration by MCC goes strange

Author
Vividhobby
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2016/11/12 19:25:43
  • Location: 0
  • Status: offline
2020/02/08 06:59:37 (permalink)
0

SPI configration by MCC goes strange

I hope your help.
MPLABX v5.3,  XC8 v2.1  MCC 3.95.0
What I would like to do.
* Generate SPI ( 4 lines , MISO, MOSI, CLK,  CS ) code by MCC.
What I got.
* I choose (CLK on RC3, SDO on RC4, SDI on RC5) 
* After generate the code, exit MCC. And then re-enter MCC, These SPI pin selection was reset as
    (CLK on RC3, SDI/SDO on RC4) 
* Try to collect them as what I did.
* I got WARNING "function SDA1 does not have output setting RC4PPS set to pin RC4.
What happend ?  What can I do to correct ?
Thsnks
#1

10 Replies Related Threads

    katela
    Super Member
    • Total Posts : 1833
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/08 08:54:22 (permalink)
    0
    Probably the SDI pin selection was not saved. Set it again to a different pin, save then generate code and see if you will get the same problem

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #2
    Vividhobby
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2016/11/12 19:25:43
    • Location: 0
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/08 17:30:43 (permalink)
    0
    Thank you for quick repley !
    Usually, "save" is done automatically when I generate the code. At this time, I tried to "save" by pressing "save Icon" again, then genarate MCC codes. However the problem is happend as same as I before.
    Also some warnig is on the notification window.
    P.S  Actually, I have been using MCC for 2-3 years, also I have an experience to use "SPI" many times without this kind of error so far. Is there anythig what I need to check ?
     
    Thanks, 
    Vivid 
    #3
    ric
    Super Member
    • Total Posts : 28009
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: SPI configration by MCC goes strange 2020/02/09 02:14:50 (permalink)
    +1 (1)
    It doesn't sound like you actually did what Katela asked.
    Did you select a DIFFERENT pin, then reselect the one you want?
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    Vividhobby
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2016/11/12 19:25:43
    • Location: 0
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/09 04:07:43 (permalink)
    0

    Hello
    Thank you for advice. Yes I did .
    Let me explain what I wanted to do. It was just to create a simple SPI setting (4 wire: CLK, CS, MOSI, MISO)
    My process was shown below.
     
    1, Create a new project.
    2, Go to MCC.
    3, add MSSP1 to the project.
    4, Click MSSP1 tub. You can see CLK on RC3, and SDi1&SDo1 on RC4 as a default.
    5, I need to have separate SDi1 and SDO1 for MiSO and MOSI, so right click on RC2 and select SDi1.
    6, So MCC asigned SDi1 on RC2 and SDO1 on RC4.
    It is fine so far.
    7, Press SAVE button.And press "Generate" to create codes.
    8, Exit MCC.
    9, Go into MCC again.
    10, SPI pin assign gose back a default setting same as 4) above.
    That is my problem.

    Thanks
    Vivid
    #5
    katela
    Super Member
    • Total Posts : 1833
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/09 05:23:59 (permalink)
    0
    Which PIC are you using? Maybe one can try to replicate your problem.
    Usually with PPS pin, I sometimes have that problem. Select a different pin, then select the required pin then generate code always work for me.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #6
    Vividhobby
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2016/11/12 19:25:43
    • Location: 0
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/09 06:06:23 (permalink)
    0
    Thanks,
    It was 16F18857, I tried to switch 16F1716, but the same issue was obserbed.
    The phenomenon looks as follows.
    The default "CLK" and "SDi/SDO" pins location are kept if it is moved. But if "SDI/SDO" pin is splitted SDI and SDO,
    the SDO pin is removed and combined with "SDI" pin as a default.
    It is OK for me the code generation is correct, even this cause me nervous.
    I hope this issue will be fixed soon.

    Thanks
    Vivid
    #7
    Mysil
    Super Member
    • Total Posts : 3678
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/09 11:48:55 (permalink)
    0
    Hi,
    There is a rewrite going on in MCC device library for MSSP peripherals in 8-bit PIC devices.
    In Device library for PIC10 / PIC12 / PIC16/ PIC18 MCUs v1.78.0 and v1.78.1
    there are changes to user interface, and code generated,
    and there seem to be different bugs for different PIC devices.
     
    For PIC18F26K22  setting MSSP1 to SDI master mode,
    correctly configure SDO1 on RC5, and SDI1 on RC4, but it
    Forget SCK1 which have to be Output on pin RC3, since this is a device without PPS.
    There is however a notification to:  'Configure SCK1,SDI1 and SDO1 as digital in Pin Module'.
    In generated code, there is logic to set TRIS bit for SCK1 pin as either Output or Input,
    depending on whether Master or Slave mode is selected.
    There is no documentation except for boilerplate license and disclaimer,
    and no example code.
     
        Mysil
     
    post edited by Mysil - 2020/02/09 15:10:53
    #8
    katela
    Super Member
    • Total Posts : 1833
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/02/09 14:42:53 (permalink)
    0
    Mysil is correct. There could be some different bugs for different PIC device with the Device library for PIC10 / PIC12 / PIC16/ PIC18 MCUs v1.78.0 and v1.78.1
    I've tried and it works with the Device library PIC10 / PIC12 / PIC16/ PIC18 MCUs v1.77.0. I tried with v1.78.0 and v1.78.1 also I got the same error.
    In the library versions, you can load an older version of the library (right-click the library version and mark for load).
     

    Attached Image(s)


    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #9
    meanilkp
    New Member
    • Total Posts : 23
    • Reward points : 0
    • Joined: 2018/08/19 22:12:10
    • Location: India
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/04/16 01:53:47 (permalink)
    +1 (1)
    This issue has been fixed in v1.81.0. Please download from below link
    https://www.microchip.com/mplab/mplab-code-configurator
     
    http://www.microchip.com/...spx?ddocname=en1001826
     

    Attached Image(s)

    #10
    Piero65
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2017/09/08 00:28:32
    • Location: 0
    • Status: offline
    Re: SPI configration by MCC goes strange 2020/07/07 09:43:50 (permalink)
    +1 (1)
    For months I have opened a support ticket in Microchip for the problem covered by this tread.
    I have the problem with the PIC16F15355, they recommended me .... use the library version xxxx, you will see that the problem is solved, the problem has not been solved, they answered me use the library yyy ... the problem has not been solved and the ticket has been open for months.
    With the PIC16F15355 I can't get an nrfc radio to work and I don't understand if this is due to errors in the management of the SPI.
    I believe that manually moving SDO1 to RC5 generating MCC files creates some errors.
    I always hope Microchip will solve the problem
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5