So, thanks a lot guys! (or gals?) For starters, just before the last two replies came in, I had a moment of "f*** it, trial and error", changed my bit timing around, and got a solid 2.000us bit time on my scope! Seeing some light at the end of the tunnel I set my monitor to 500 kbp/s, and it works :D Since I've been trying to figure out what the deal-breaker was, this is great news and thanks a lot for helping me exclude some stuff from my search. All the disable bits (PMDx registers) for ECAN and DMA are set to 0 -Enabled interrupts for: ECAN, C1TX, C1RX, DMA, DMA0, DMA1, and each have an ISR clearing the flags Any insight is hugely welcome! When a message is send to the dsPIC, besides not getting Acked, the _C1Interrupt ISR does NOT get called -And as such no message is received -Sending a message from the dsPIC (or trying to) results in the first word getting send on the bus, but the message keeps repeating -At the same time, the code hangs in a loop waiting for the TXREQn bit to be cleared by the hardware (C1TRnmCON register) -Noticing no filter/mask values present in the SFRs, I rewrote the function to write to specified SFRs (as shown in screenshot) -Doubting myself and my interpretation of presented information, I recalculated my Bit Timing for 1Mbps 60Mhz Fcy with 12Mhz crystal (FCAN =2*Fcy, SJW = 2Tq, PH1 = 8 Tq, PH2 = 4 Tq, Prop = 8 Tq, 1 sample at 80%, BRP = 2) -Rechecked DMA initiation chanel 0 is CANTX, aligned to my defined CAN buffer. Some insight into what I've done/tried so far (for ECAN): -Physical layer is correct scope shows nice pattern for both Tx and Rx at the right voltage levels -Messages send from my CAN box (Anagate CAN duo) do NOT get Acked as shown by the Anagate interface. The same seems to be happening with the C1BUFPNTn SFRs, I wrote BUFPNT 1, 2 and 3 to 0xFFFF (FiFo) but the SFR map does not show any value for those registers. So far I've been trying to narrow down the reasons as to why it isn't working, and ran into this issue. So, can someone shed some light on what is happening here? I've been trying to get ECAN to work for over a week now (see my previous post) and so far to no avail. As expected from the window functionality (WIN bit) the C1TRnmCON registers show 0x0 when WIN=1, and 'revert' back to the configured values when WIN=0. The WIN bit in C1CTRL1 is set to 1, enabling access to the filter/buffer registers. Hello While trying to get ECAN to work on the mentioned chip, I noticed something strange: AFTER writing C1RXF0SID and C1RXM0SID, both registers show no value. DsPIC33E(256MC506) SFR with no address and no value.?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |