PIC 18F4585 - CAN-related registers

Thread Starter

atferrari

Joined Jan 6, 2004
4,771
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.
 

Papabravo

Joined Feb 24, 2006
21,228
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.
 

Thread Starter

atferrari

Joined Jan 6, 2004
4,771
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.
 

Papabravo

Joined Feb 24, 2006
21,228
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.
 

Thread Starter

atferrari

Joined Jan 6, 2004
4,771
I agree with you that it is not obvious how the mapping is performed.
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.
 
Top