View previous topic :: View next topic |
Author |
Message |
Tufican
Joined: 23 Feb 2011 Posts: 10 Location: Turkey- izmir
|
can bus baud problem(125k OK!) (250k OK!) 500k (FAIL!!): |
Posted: Mon Oct 03, 2011 2:37 pm |
|
|
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
|
|
|
Tufican
Joined: 23 Feb 2011 Posts: 10 Location: Turkey- izmir
|
|
Posted: Tue Oct 04, 2011 7:58 am |
|
|
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
|
|
Posted: Tue Oct 04, 2011 8:24 am |
|
|
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
|
|
Posted: Tue Oct 04, 2011 9:18 am |
|
|
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
|
|
Posted: Tue Oct 04, 2011 9:50 am |
|
|
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
|
|
Posted: Tue Oct 04, 2011 3:01 pm |
|
|
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 |
|
|
|