• AVR Freaks

Hot!SENT Protocol & Serial to USB with PIC

Author
racingsubby
Starting Member
  • Total Posts : 62
  • Reward points : 0
  • Joined: 2010/06/22 10:34:11
  • Location: 0
  • Status: offline
2020/05/30 18:02:12 (permalink)
0

SENT Protocol & Serial to USB with PIC

Hi,
I'm working on something new.  I need to create a SENT protocol simulator to simulate some signals from a device.  Tick time is around 3us.  Not sure how to go about doing this.  Would you just use a digital I/0?  With that short of a tick time, I'm trying to figure out how to code it so I can update signals from a PC interface.
On that note, what's the best way to talk to a PC.  I'm assuming using UART.  I know there's FTDI (?) cables out there.  Anyone know of a small chip or demo board that does this conversion so I could have just a micro USB port on the side of a box?

I currently have been using PIC16F1619's because the Curiosity board came with them and then I bought several for spares.  Its worked for me for some other small projects and its good because its a small package.  I'm hoping it would work for this.
 
Any feedback is appreciated!
Thanks!
post edited by racingsubby - 2020/05/30 18:27:39
#1

9 Replies Related Threads

    mbrowning
    USNA79
    • Total Posts : 1768
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: offline
    Re: SENT Protocol & Serial to USB with PIC 2020/05/30 19:55:16 (permalink)
    +1 (1)
    Microchip, Silicon Labs, and FTDI make usb-uart chips. I use mostly CP2108 and FT4232H, but for hand built protos that need only 1 uart I use FT230X. Haven’t used any Microchip parts but they are probably fine too.
    #2
    pcbbc
    Super Member
    • Total Posts : 1698
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: SENT Protocol & Serial to USB with PIC 2020/05/30 21:12:21 (permalink)
    +1 (1)
    Plenty of ready made FTDI boards and clones in the Arduino world for USB to UART.
    Just google Arduino FTDI on your favourite auction site.
    #3
    RISC
    Super Member
    • Total Posts : 5732
    • Reward points : 0
    • Status: online
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 07:29:24 (permalink)
    +1 (1)
    Hi,
    The MCP2221A also implement UART / I2C <=> USB bridge as a black box.
    Its main benefit is that it does not need any external XTAL.
    If you want to do something even cheaper, then go for PIC16F145x family and implement USB device CDC class.
    There are ready made examples of that in old the MLA framework and maybe in MCC USB library (to be checked).
    Additionally, if you use the PIC16F145x family you can potentially add you own application like the SENT or customize without any any other device externally...
    Regards
     
    #4
    JPortici
    Super Member
    • Total Posts : 1082
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: online
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 11:32:21 (permalink)
    0
    You need a simulator? or a signal analyzer? it's not clear from what you write. One problem may be solved by the PIC16, the other won't. Not on a per-message basis.
    By the way, get a copy of the standard. It seems to me you know very little about the protocol.. information is still scarce around the net and most of it won't help you in your task.
    I have already solved your issue so it can be done :) It's a tool for internal use.. we never really talked about making an actual product out of it
    #5
    racingsubby
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2010/06/22 10:34:11
    • Location: 0
    • Status: offline
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 12:32:28 (permalink)
    0
    Thanks mbrowning!  That's the stuff I was looking for.  Just want to confirm, so do those device take in the TTL UART signals (0-5V) right from the PIC?  I don't have to do anything with the RS232 voltage level of +/-3 to 15V correct?
    #6
    racingsubby
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2010/06/22 10:34:11
    • Location: 0
    • Status: offline
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 12:34:54 (permalink)
    0
    Thanks PCBBC.  I just replied to mbrowning.  The one question I have is, do these devices take the Tx, Rx, etc. right from the PIC in 0-5V form?  I'm assuming they do.
     
    #7
    racingsubby
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2010/06/22 10:34:11
    • Location: 0
    • Status: offline
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 12:36:57 (permalink)
    0
    RISC!  This is very good info.  I'll take a look at things.  I'll admit, I'm new to UART with a PIC and mostly an amateur in general.  What do you mean by CDC class and MLA framework?  I'll definitely look at the PIC16F145X family!
     
    #8
    racingsubby
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2010/06/22 10:34:11
    • Location: 0
    • Status: offline
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 12:51:58 (permalink)
    0
    JPortici.  I need to be able to simulate the SENT messages that a position sensor sends back to an ECM.  Its using section H.1 of the SAE J2716 specification which is for two 12-bit fast channels.  The first 3 nibbles are the first signal, sent MSN (most significant nibble) to LSN.  Then the last 3 are the 2nd signal but with the nibbles sent in reverse (LSN to to MSN).
    So the frame consists of:
    56-tick Sync Pulse
    Status and Communication Nibble
    Signal 1 Nibbles
    Signal 2 Nibbles
    CRC - Which I need to figure out how to do yet! :)
    Pause Pulse
     
    So what I need to make is something that will create this message frame and continuously send it out on the buss.  Meanwhile, I will have a GUI on the PC where the operator sets the positions sensors to the value they need.  That information gets transferred via serial to the PIC, the PIC then needs to update the message frame with the modified values of the signal.
    I'll admit, I'm still an amateur at this.  I haven't done SENT nor serial communication to a PC yet with a PIC.  Most things I've done involved digital I/O, analog reads, and sending information to an LCD.  So this is new to me.  Trying to expand my knowledge! :)
     
    Thanks!
     
    post edited by racingsubby - 2020/05/31 12:55:07
    #9
    JPortici
    Super Member
    • Total Posts : 1082
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: online
    Re: SENT Protocol & Serial to USB with PIC 2020/05/31 15:06:30 (permalink)
    0
    At least you have the standard at hand :) that should give you all the information you need also on the shape of the signal and associated hardware.
    You can probably manage to generate one or two channels with a PIC18.. maybe a PIC16 if you precompute everything and reduce the math and the logic to a minimum.
    I tend to dislike using CDC and USB/UART-TTL cables, i would rather do a HID device with a 18F25K50
    And i can see how it could be an even steeper road but it will pay off in the future. UART is slow, CDC is clunky. HID is perfect for small control tasks like these
    #10
    Jump to:
    © 2020 APG vNext Commercial Version 4.5