PIC 18F4585 - CAN-related registers

Discussion in 'Computing and Networks' started by atferrari, Jan 7, 2008.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    18F4585 - For CAN bus applications

    I am trying to know exactly how the different registers (mentioned in pag 280 of the datasheet) are mapped when selected by ECANCON <EWIN4:0> Before going into hardware I want to know exactly where each one shows up when selected.

    List and explanation too criptic to be of real use. Buffers are obvious but, what about the others?

    Two questions:
    a) Anyone with hands on experience on the 18F4585 to tell how (sequence-respective address) they are ACTUALLY mapped in that range when selected. Trial and error is not easy (if at all possible) and MPSIM is not that helpful to have a complete picture.

    b) Is it anyone one actually using EWIN<4:0> bits in ECANCON to address CAN-related registers? Or do you always use BANKSEL macro and forgot all that?

    Just in case I use Assembly, not C.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,142
    1,790
    Think of it as bankselect bits for CAN objects. A CAN object can be either a frame to be transmitted when the CAN controller succeeds in winning arbitration, OR a frame that was received that passed through the filters which look for a match on the identifier and possibly some of the bits of the data field. A fully accessible CAN controller (Intel 82527 - no longer made) had 256 registers. This would be difficult to implement on a PIC without some serious disruption.
     
  3. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    Hola PB,

    I truly understand the concept. Buffer are SO obvious that I discarded them as part of my problem.

    What I don't know is the actual order/sequence in what other registers appear mapped there.

    The explanation (barely a mention of the registers) is not conclusive. What leaves place for doubts is that the registers mapped as per every value in EWIN<4:0> bits makes not for a full chunk fitting exactly in the "window" range (F60-F6Dh)

    By trial and error I got some, but others, based in my experience would demand so a complex test that I would end devoting too many weeks for that. No thanks.

    Have you got any hands on experience with that one?. I whish you say yes.

    Helpful as usual. Gracias.
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,142
    1,790
    Sadly no. I've worked with many different CAN controllers but this is not one of them. Some registers do relate to all message objects and some registers relate only to a specific object. I'll take a look at the datasheet and get back to you.

    EDIT: I agree with you that it is not obvious how the mapping is performed.
     
  5. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    This is encouraging! I was affraid of something being so obvious and myself unable to see it.

    I started a "ticket" (help request to Microchip) but the answers were incredibly vague. Yours is much better.

    By the way, the code "01111" is said to map registers RXINT0 and RXINT1. They do not even exist for that micro (checked the 18F4585.inc file as well).

    Thanks for your time and effort.
     
Loading...