Forum: Mikrocontroller und Digitale Elektronik mcp2515 anschaltung tranceiver


von andy (Gast)


Lesenswert?

Hallo

Ich habe eine Frage zur Pinbelegung Cancontroller zum CAN Tranceiver.

Nach dem Schaltplan von Kreativ Caos ist der RXPIN (MCP2515) mit dem 
RXPIN (MCP2551) verbunden habe bei mir jetzt gemessen das funktioniert 
doch so nicht oder der rx muß doch mit dem TX und umgekehrt???

Oder????

Bekomme einfach nichts aus dem BUS


Gruß

Andy

von (prx) A. K. (prx)


Lesenswert?

Da der CAN Bus keine getrennte Leitungen für beide Richtungen besitzt, 
besteht auch keinerlei Veranlassung, die Leute ähnlich wie bei RS232 zu 
verwirren. Daher trägt bei CAN die Rx-Leitung vom Transceiver das 
Empfangssignal und gibt es an die Rx Leitung des Controllers weiter.

von andy (Gast)


Lesenswert?

Hallo

Ja habe ich auch noch mal nachgelesen auf der Microship seite die hatten 
auch einen Schaltplan.


Es funktioniert nun alles.


ABer mit den Bit timing komme ich nicht weiter.


Habe es mit der Seite berechnet und mal eingestellt aber keine 
Kommunikation mit den Werten die dort errechnet werden.


The following bus parameters are allowed, assuming

your CAN controller is clocked with 16 MHz,
you want a CAN bus bit rate of 250 kbps,
settings leading to speed deviations of more than 0.5% are discarded.

T1 T2 BTQ SP% SJW Bit Rate Err% CNF1 CNF2 CNF3
8 8 16 50 1 250 0 01 9a 07
8 8 16 50 2 250 0 41 9a 07
8 8 16 50 3 250 0 81 9a 07
8 8 16 50 4 250 0 c1 9a 07
9 7 16 56.25 1 250 0 01 9b 06
9 7 16 56.25 2 250 0 41 9b 06
9 7 16 56.25 3 250 0 81 9b 06
9 7 16 56.25 4 250 0 c1 9b 06
10 6 16 62.5 1 250 0 01 a3 05
10 6 16 62.5 2 250 0 41 a3 05
10 6 16 62.5 3 250 0 81 a3 05
10 6 16 62.5 4 250 0 c1 a3 05
11 5 16 68.75 1 250 0 01 a4 04
11 5 16 68.75 2 250 0 41 a4 04
11 5 16 68.75 3 250 0 81 a4 04
11 5 16 68.75 4 250 0 c1 a4 04
12 4 16 75 1 250 0 01 ac 03
12 4 16 75 2 250 0 41 ac 03
12 4 16 75 3 250 0 81 ac 03
12 4 16 75 4 250 0 c1 ac 03
13 3 16 81.25 1 250 0 01 ad 02
13 3 16 81.25 2 250 0 41 ad 02
13 3 16 81.25 3 250 0 81 ad 02
13 3 16 81.25 4 250 0 c1 ad 02
14 2 16 87.5 1 250 0 01 b5 01
14 2 16 87.5 2 250 0 41 b5 01
14 2 16 87.5 3 250 0 81 b5 01
14 2 16 87.5 4 250 0 c1 b5 01
4 4 8 50 1 250 0 03 88 03
4 4 8 50 2 250 0 43 88 03
4 4 8 50 3 250 0 83 88 03
4 4 8 50 4 250 0 c3 88 03
5 3 8 62.5 1 250 0 03 89 02
5 3 8 62.5 2 250 0 43 89 02
5 3 8 62.5 3 250 0 83 89 02
5 3 8 62.5 4 250 0 c3 89 02
6 2 8 75 1 250 0 03 91 01
6 2 8 75 2 250 0 43 91 01
6 2 8 75 3 250 0 83 91 01
6 2 8 75 4 250 0 c3 91 01

Explanations
T1: the number of quanta before the sampling point.
T2: the number of quanta after the sampling point.
BTQ: the number of quanta per bit.
SP%: the position of the sampling point, in percent of the whole bit.
SJW: the Synchronization Jump Width.
Bit Rate: the resulting bus speed, in kbps.
Err%: the deviation, in percent, from the desired bit rate.
CNF0: Configuration Register 0, in hex
CNF1: Configuration Register 1, in hex
CNF2: Configuration Register 2, in hex


http://www.kvaser.com/en/support/bit-timing-calculator.html

Mit den Werten von kreativ chaos geht es allerdings mit 125Kbit brauche 
aber 250kbit.


Danle

Gruß

Andy

von (prx) A. K. (prx)


Lesenswert?

Welche Werte hast du jeweils mit 125/250kbps probiert? Wie sieht der 
betreffende Code aus?  War es Blindflug oder glaubst du, diese Parameter 
leidlich verstanden zu haben?

von andy (Gast)


Lesenswert?

HAllo

Leider habe ich es nicht verstanden das mit den Berechnen des Tinings.

Habe etliche werte probiert und n un geht nichts mehr.

Es kommen zwar Signale an aber der INT des MCP kommt nicht mehr dabei 
hat es so gut vorher geklappt.

Ich weiß nicht weiter.

Danke

Gruß

Andy

von andy (Gast)


Lesenswert?

Hallo


Inzwischen läuft es wieder aber nur mit 125kb

gruß

andy

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.