CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

can bus baud problem(125k OK!) (250k OK!) 500k (FAIL!!):

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tufican



Joined: 23 Feb 2011
Posts: 10
Location: Turkey- izmir

View user's profile Send private message

can bus baud problem(125k OK!) (250k OK!) 500k (FAIL!!):
PostPosted: Mon Oct 03, 2011 2:37 pm     Reply with quote

hello everybody :)
I have a problem about my ccs c canbus development kit.

I can set my baud to 50 - 125 - 200 max to 250.
The true and good working 125k.


But I can't set 300 or 500 or 1m ( what I need for 500k or 1m?)

I'm using this setup for 125k good working
clock =20mhz(i dont using pll)
prescalar =4
seg1 =5
propagation=2
seg2 =5

and so.. when i changed my baud rate settings(prescalar = 1), output does like this
:((

I need to pic18f4580 500k settings can anybody help me :(


Sorry about my english.
Thank you for help
best regards.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 03, 2011 2:50 pm     Reply with quote

This thread has instructions on how to download a program to calculate
the CAN bus baud rate settings, and how to use the program:
http://www.ccsinfo.com/forum/viewtopic.php?t=22138
Tufican



Joined: 23 Feb 2011
Posts: 10
Location: Turkey- izmir

View user's profile Send private message

PostPosted: Tue Oct 04, 2011 7:58 am     Reply with quote

PCM programmer wrote:
This thread has instructions on how to download a program to calculate
the CAN bus baud rate settings, and how to use the program:
http://www.ccsinfo.com/forum/viewtopic.php?t=22138

Thank you so much pcm programmer but...
I had look this topics and i start to use that Microchip can baud rate timing calculator software.
I tried everything about 500k, i tried so much combination but it doesn't work :(

I can set my baudrate 50 100 150 200 250 nice working
but when i set 250>>

Program is not working.

My transceiver is support 1mbps.

But I can't set 250 or high baud rate.

Please help me.
I have 2 device.

1st 20mhz osc (not pll) pic18f4580
2st 8 mhz osc (32mhz with pll) pic 18f458

Anybody send me a working sample code and baud settings.
How can I solve this problem??

Best regards (please help me) :oops: :cry:
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Tue Oct 04, 2011 8:24 am     Reply with quote

Did you check the ASM generated(Program Memory)?
Specifically the Baudrate setting part.

May be is a bug in the code compiler, I remember something similar with I2C.
_________________
Electric Blue
Tufican



Joined: 23 Feb 2011
Posts: 10
Location: Turkey- izmir

View user's profile Send private message

PostPosted: Tue Oct 04, 2011 9:18 am     Reply with quote

E_Blue wrote:
Did you check the ASM generated(Program Memory)?
Specifically the Baudrate setting part.

May be is a bug in the code compiler, I remember something similar with I2C.


Thank you e.blue

But i don't know anything about assembly language.

And I'm using original ccs c canbus kit.

And I'm using original ccs c sample files.
I didn't change nothing in the code.
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Tue Oct 04, 2011 9:50 am     Reply with quote

First you must open the datasheet of your PIC micro that are you using and look for the register that control the CAN bus baudrate.

Second, go to your code(MPLAB IDE) and, in debug mode, put the cursor over the line that sets the baudrate and do a right click over it, a contextual menu appear, left click on Set PC at cursor.

Now go to tool bar View--> Program Memory(left click).

With the cursor over the Program Memory window do a right click over it a contextual menu appear, left click on Center debug location.

Thats it your are on the ASM code that sets the baud rate, now just look for some MOVLW, MOVF instructions that point to the address of the register that you see on the datasheet at beginning.
_________________
Electric Blue
Tufican



Joined: 23 Feb 2011
Posts: 10
Location: Turkey- izmir

View user's profile Send private message

PostPosted: Tue Oct 04, 2011 3:01 pm     Reply with quote

E_Blue wrote:
First you must open the datasheet of your PIC micro that are you using and look for the register that control the CAN bus baudrate.

Second, go to your code(MPLAB IDE) and, in debug mode, put the cursor over the line that sets the baudrate and do a right click over it, a contextual menu appear, left click on Set PC at cursor.

Now go to tool bar View--> Program Memory(left click).

With the cursor over the Program Memory window do a right click over it a contextual menu appear, left click on Center debug location.

Thats it your are on the ASM code that sets the baud rate, now just look for some MOVLW, MOVF instructions that point to the address of the register that you see on the datasheet at beginning.


thank you e.blue

i am very apprentice for debugging but i will try that
and i try to teach debugging

thank you so much
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group