MicroMod Digital 2 CAN in to High side output

Application-specific PCAN-MicroMod Motherboards
Post Reply
Gelby
Posts: 4
Joined: Thu 12. May 2022, 17:12

MicroMod Digital 2 CAN in to High side output

Post by Gelby » Fri 5. Jul 2024, 12:19

Hello all,
new to MicroMod devices, I need to activate one High side output depending on the value of two bits of one byte of a CAN received message ( for instance, if I receive a CAN message with byte 0 value 0x03 I activate one High side output, if the byte 0 value is 0x00, 0x01 or 0x02 I deactivate the output).
I read the programming software documentation and I learned how to do this only by evaluating one bit in one byte, but I need to evaluate two bits in a byte.
Please help me.
Thanks in advance

M.Heidemann
Sales & Support
Sales & Support
Posts: 1027
Joined: Fri 20. Sep 2019, 13:31

Re: MicroMod Digital 2 CAN in to High side output

Post by M.Heidemann » Fri 5. Jul 2024, 15:21

Hello,

One option would be to use the PWM function,
you can use scale and offset to get your intended results,
here a screenshot of an example of a low-side driver being
used to mirror your application:
2024-07-05 14_59_50-Frequenzout_mit_offset.mcfx - PCAN-MicroMod Configuration.png
2024-07-05 14_59_50-Frequenzout_mit_offset.mcfx - PCAN-MicroMod Configuration.png (20 KiB) Viewed 1901 times
Alternatively you could feed back Outputs you switch with your message and then use the Digital Function to switch your intended output:

In your case you would use an AND function

your two bits both need to be 1 to trigger the output,
so logically this means:

0x00
bit0 = 0
bit1 = 0_____> False = No Output

0x01
Bit0 = 0
Bit1 = 1_____> False = No Output

0x02
Bit0 = 1
Bit1 = 0_____> False = No Output

0x03
Bit0 = 1
Bit1 = 1_____> True = Switch Output
Digital function.png
Digital function.png (48.15 KiB) Viewed 1901 times

Please let me know if you were able to use one of the methods successfully.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Gelby
Posts: 4
Joined: Thu 12. May 2022, 17:12

Re: MicroMod Digital 2 CAN in to High side output

Post by Gelby » Fri 5. Jul 2024, 16:17

Hello Marvin,
thanks for you reply, I think to try the second option, anyway, what is unclear to me is the association between the 2 bits in the CAN input message and the Digital Output.
I mean, in your digital function, I see an logic AND operation between Digital Input 0 and Digital Input 1, but I need the logic AND between bit 0 and bit 1 of the byte zero of a particular CAN input message, could you explain this connection better? Where this association take part?
Thank you

M.Heidemann
Sales & Support
Sales & Support
Posts: 1027
Joined: Fri 20. Sep 2019, 13:31

Re: MicroMod Digital 2 CAN in to High side output

Post by M.Heidemann » Fri 5. Jul 2024, 16:28

Hi,

Sure, let me explain this a bit further:

You use two DOuts that act as a stand in for your bits on the byte of your CAN-ID you want to use to switch the High-Side Dout.

So you define two Douts:

Dout #1:

Your incoming CAN-ID

Start Byte 0
Start Bit 0
Power-Up Value 1

Dout #2:

Your incoming CAN-ID (Same as for Dout#1)

Start Byte 0
Start Bit 1
Power-Up Value 1

Bit0 & bit1 will only be 1 if the incoming message is at least 0x03h, so in this case
you can feed them back into the inputs and use the logic function with AND, as showcased before.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Gelby
Posts: 4
Joined: Thu 12. May 2022, 17:12

Re: MicroMod Digital 2 CAN in to High side output

Post by Gelby » Fri 5. Jul 2024, 16:45

Dear Marvin,
now it is more clear to me and make sense, as soon as I will give it a try, I will give you a feedback.
Regards

Post Reply