• AVR Freaks

Hot!LIN Slave with PIC18F66K80 on ADM00716

Author
YOON
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2020/07/31 16:10:09
  • Location: 0
  • Status: offline
2020/08/08 08:40:48 (permalink)
0

LIN Slave with PIC18F66K80 on ADM00716

I am a new user of Microchip development platform and LIN project. I am trying to build and demonstrate a simple LIN Slave control (LED, motor, etc.) with the following:
  • Automotive Networking Development Board (ADM00716)
  • PIC18F66K80 (100-pin)
  • MCP2003B click LIN transceiver
  • MCP25625 click CAN controller
  • LIN Serial Analyzer (APGDT001)
  • PICkit 4
In addition to LIN 2.2 resources, I am following the Microchip document ‘ATA6563 Click Quick Start Guide’ and ‘LIN Basics and Implementation of the MCC LIN Stack Library on 8-Bit PIC® Microcontrollers (AN2059)’, but there are number of discrepancies in the document for my setup. If anybody has worked with these configuration, can you please share your working IDE project/code for me to reference? Thank you.
 
Also, if I am using wrong HW configuration, can you kindly let me know what components I need to replace/add.
 
Thank you again!
#1

9 Replies Related Threads

    ric
    Super Member
    • Total Posts : 28378
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/10 18:37:52 (permalink)
    0
    Sorry, can't help. I'm just replying to bump your thread back to the top of the list, as the moderators took 2 days to approve your membership.
     

    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!
    #2
    YOON
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2020/07/31 16:10:09
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/10 19:06:30 (permalink)
    0
    Thank you 'ric' for your help!  (:
    #3
    tam07
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2016/04/04 18:39:11
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/10 20:10:30 (permalink)
    0
    Hello Chris, your available hardware is fine. The LIN stack generated by MCC should work on any 8-bit PIC device with UART. Just make sure that you have the correct routing from your PIC18F66K80 pins to the MCP2003B click board. 
    #4
    YOON
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2020/07/31 16:10:09
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/11 06:15:29 (permalink)
    0
    Hello 'tam07'. Thank you for confirming my setup and providing links to the user's guide resources. I have also been using 'PIC18F66K80 FAMILY' (http://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F66K80%20FAMILY%20Enhanced%20Flash%20MCU%20with%20ECAN%20XLP%20Technology%2030009977G.pdf) as added reference and every bit (literally) of information helps.
     
    As you suggested, I have followed the instruction on AN2059 to map the pins to MCP2003B and got stuck on step 18 (LIN Slave) to identify 'FAULT/TXE' pin location on the MCP2003B click. According to the mikroBUS interface schematics on Automotive Networking Board user's guide for Click 3, it seems TX-4 (click3TX) is the pin out. I traced click3TX via J27 to P7 PIM pin. However, when I referece the '64-pin to 100-pin PIM mapping table' on the PIC18F66K80 user's guide, PIM pin 7 is not listed. I aslo made sure the jumper settings on UART JUMPER BLOCK is configured correctly as TX1/P51 and RX1/P52 for MB3 (Click 3). According to 'FIGURE 23' on the AN2059, 'FAULT_TXE' should be enabled with WPU (weak pull-up). Is it possible, MCP2003B 'FAULT/TXE' function defaults to EUSART1 TX?
     
    Also, I am not sure as to why ADC needs to be configured per step 20 (LIN Slave) of the AN2059. Any explanation would help me to better understand the setup/flow.
     
    Finally, would you recommend for or against using MCC SWUART module vs hardware EUSART module? Just want to make sure I make the right choice now and don't end up pulling my hair out later.
     
    Thank you for reviewing my questions.
    #5
    tam07
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2016/04/04 18:39:11
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/11 18:06:20 (permalink)
    0
    As you suggested, I have followed the instruction on AN2059 to map the pins to MCP2003B and got stuck on step 18 (LIN Slave) to identify 'FAULT/TXE' pin location on the MCP2003B click. According to the mikroBUS interface schematics on Automotive Networking Board user's guide for Click 3, it seems TX-4 (click3TX) is the pin out. I traced click3TX via J27 to P7 PIM pin. However, when I referece the '64-pin to 100-pin PIM mapping table' on the PIC18F66K80 user's guide, PIM pin 7 is not listed. I aslo made sure the jumper settings on UART JUMPER BLOCK is configured correctly as TX1/P51 and RX1/P52 for MB3 (Click 3). According to 'FIGURE 23' on the AN2059, 'FAULT_TXE' should be enabled with WPU (weak pull-up). Is it possible, MCP2003B 'FAULT/TXE' function defaults to EUSART1 TX?

     
    The example in AN2059 utilizes a PICkit™ 28-pin LIN Demo Board that carries a MCP2021 LIN transceiver which has a different pin configuration with the MCP2003B. If you read through the MCP2021 datasheet, the FAULT/TXE is used to signal when to enable/disable the transmitter driver and to detect fault condition in the bus as well. However, if you look closely to the MCP2003B schematic, the transceiver does not have a FAULT/TXE pin and the click board already provides the pull-up for the CS pin. (The server wouldn't allow me to upload image right now...)
     
    Also, I am not sure as to why ADC needs to be configured per step 20 (LIN Slave) of the AN2059. Any explanation would help me to better understand the setup/flow.

     
    As specified in step 19 of AN2059, ADC is configured to demonstrate the sample application. You don’t really need to configure it. But it you want to reproduce the demo to at least see if your setup is working as expected, then you may opt to follow this step.
     
    Finally, would you recommend for or against using MCC SWUART module vs hardware EUSART module? Just want to make sure I make the right choice now and don't end up pulling my hair out later.

     
    I suggest you use the hardware EUSART. Only use the SWUART if you’ve already used up all the hardware EUSARTs.
     
    Thank you for reviewing my questions.

     
    Sure, hope this helps. I don’t have an MCP2003B click with me right now but I’ve used it before and the implementation should be pretty straightforward. 😊
    #6
    YOON
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2020/07/31 16:10:09
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/12 09:30:25 (permalink)
    0
    Hello 'tam07'! Thank you so very much for your detailed response. It definitly helps me to clarify my confusion. I am able to successfully build the LIN Slave configuration environment in my IDE. Now, I just need to resolve my LIN Serial analyzer that is not initializing. I am suspecting wiring.
     
    Thank you again for great support!  (-:
    #7
    YOON
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2020/07/31 16:10:09
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/24 09:59:41 (permalink)
    0
    After a week of troubleshooting my current setup and LIN Slave configuration, I am starting to question if the AN2059 LIN Slave example as outlined actually works or not. If anybody was able to successfully execute the LIN Slave example and receive potentiometer response, can you please share how you did it.  Thank you.
    #8
    GlennP
    Super Member
    • Total Posts : 833
    • Reward points : 0
    • Joined: 2009/03/29 15:04:55
    • Location: El Paso County, CO, USA
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/25 02:46:08 (permalink)
    +2 (2)
    I cannot comment on your specific question (I used different H/W and wrote my own LIN S/W from the then-free LIN spec), but I will say that when I first did LIN protocol work I made much faster progress after I got a LIN protocol analyzer connected.  My Tek MDO 3024 has an add-on ($$) and the Saleae logic analyzers have a free LIN analyzer available.  I'm sure there are others available too - I just happen to have those.
     
    GP
    #9
    YOON
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2020/07/31 16:10:09
    • Location: 0
    • Status: offline
    Re: LIN Slave with PIC18F66K80 on ADM00716 2020/08/25 06:12:38 (permalink)
    0
    Hello GP. Thank you for responding. I was considering about getting the protocol analyzer and you just helped me to confirm my next step. Thank you again!
    #10
    Jump to:
    © 2020 APG vNext Commercial Version 4.5