Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Piclist | CAN programming problem on the 18F4685 ?

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

CAN programming problem on the 18F4685 ? - Dennis Clark - Jun 4 11:49:13 2008

Hi all,

I have an 18F4685 project that I'm trying to get the CAN code working
with, but for some reason the CAN bus module isn't coming out of CONFIG
mode or something. It won't transmit or receive data and it holds the CAN
Tx line low which is a _bad_ thing for the bus. I have code in assembly
that uses the CAN module in mode 0 that is working, but I am trying to use
the MC CAN C lib routines to run the CAN module in mode 2 (FIFO) and it
just won't work. Oh and yes, I've tried running mode 0 and it does the
same thing.

The code base I'm using I have used with the 18F6680 for years with no
issue, there is no difference in the CAN config registers between the 4685
and the 6680 (that I can see), but it won't work. Grr. I must assume
that there is some silicon difference, but no errata on the 4685 says
anything about this kind of thing. If anyone else reads this and has
FOUND some kind of difference, boy I'd love to hear from you!

DLC
--
Dennis Clark
TTT Enterprises
------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


Re: CAN programming problem on the 18F4685 ? - Todd Hochwitz - Jun 10 20:10:29 2008

Dennis Clark wrote:
> If anyone else reads this and has FOUND some kind
> of difference, boy I'd love to hear from you!

Not exactly what you requested, but I completed a CAN-based project for
both the 18F2680 and 18F4685 a couple of months ago, and ran into no
problems with either chip (running strictly in Mode 0 using my own code
- I did not use Microchip's library). The CAN code for both chips was
identical. Never ran into the problem you have described.

I know it is not very likely, but could the chip itself be bad? Might
be worth trying the code on a different 18F4685. I've had a PIC24
behave like that on me - code acted odd, didn't find errata that
described the problem, tried a different chip of the same revision level
and it worked fine. Rare, but it can happen.

--
Todd Hochwitz

http://www.technical-mandala.com
h...@technical-mandala.com
Phone: (970) 231-4857
Fax: (509) 753-6337

Technical Mandala
709 E. Elizabeth St.
Fort Collins, CO 80524-3842

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: CAN programming problem on the 18F4685 ? - dlc - Jun 10 23:48:11 2008

Hi,

Thanks for the response. I could duplicate the problem on two
different systems with two different types of the chip. I found out
what went wrong. A nice low key paragraph says that the CAN module will
override any TRIS settings you use, but the user needs to set TRIS on
the TX pin.
Reading this and the portb information very carefully and taking it
very literally meant that I needed to set the CAN Tx line's TRIS bit to
1. Yes, it needed to be set as an input or it would not work as an
output. Obvious huh? Anyway, after I set the TRIS bit = 1 it all
started to work.

Man, what a week,
DLC

Todd Hochwitz wrote:
> Dennis Clark wrote:
>> If anyone else reads this and has FOUND some kind
>> of difference, boy I'd love to hear from you!
>
> Not exactly what you requested, but I completed a CAN-based project for
> both the 18F2680 and 18F4685 a couple of months ago, and ran into no
> problems with either chip (running strictly in Mode 0 using my own code
> - I did not use Microchip's library). The CAN code for both chips was
> identical. Never ran into the problem you have described.
>
> I know it is not very likely, but could the chip itself be bad? Might
> be worth trying the code on a different 18F4685. I've had a PIC24
> behave like that on me - code acted odd, didn't find errata that
> described the problem, tried a different chip of the same revision level
> and it worked fine. Rare, but it can happen.
>

--
-------------------------------------------------
Dennis Clark TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )