• AVR Freaks

Hot![Solved] Harmony CAN configuration

Author
luker
Super Member
  • Total Posts : 183
  • Reward points : 0
  • Joined: 2015/04/17 06:24:04
  • Location: 0
  • Status: offline
2020/08/19 07:31:25 (permalink)
0

[Solved] Harmony CAN configuration

Hi forum,
 
we all know that receiving is harder than sending regardless of the bus type. My Harmony 2.06 in the MPLabX5.30 is configured to generate PIC32MK0512GPE064 configuration code for its fourth CAN module. It does send CAN messages really nice.
 
Now I'm throwing messages at it while polling every millisecond DRV_CAN_ChannelMessageReceive(). It returns true in the very next moment after I have sent a CAN message into it. But the message is empty.
uint8_t data[8];
 
memset(data, 0, sizeof(data));
 
bool newMessageReceived = DRV_CAN_ChannelMessageReceive(appData.CANCommHandle, CAN_CHANNEL1, 0x000, 8, data);
 

appData.CANCommHandle is the same I use for sending, where it works.
CAN_CHANNEL1, I hope, refers to can channel 1, which is configured as CAN_RX_FULL_RECEIVE with a filter of 0x7fff and a mask 0.
The next zero I don't know what else to put there.
And data is the buffer that still shows all zeros despite newMessageReceived being true.
 
Oh, and I did send not all zeros, btw.
 
What is it that I'm missing that will get CAN reception to work?
post edited by luker - 2020/08/26 03:06:53
#1
luker
Super Member
  • Total Posts : 183
  • Reward points : 0
  • Joined: 2015/04/17 06:24:04
  • Location: 0
  • Status: offline
Re: Harmony CAN configuration 2020/08/26 03:06:35 (permalink)
5 (2)
Solution: If your hardware connects to the pins of CAN module #4, then you should configure #4 and not #1.
#2
Jump to:
© 2020 APG vNext Commercial Version 4.5