how to use digital out (Dout)

Universal Programmable Converter for CAN FD and CAN
Post Reply
rixccaptv
Posts: 1
Joined: Wed 14. Apr 2021, 03:23

how to use digital out (Dout)

Post by rixccaptv » Wed 14. Apr 2021, 03:28

Hi.

I want to install a small buzzer in a vehicle build and control it via the Dout pin.
I did not find any code example of how to set this up (for example, how to set output voltage) and trigger it...

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

Re: how to use digital out (Dout)

Post by M.Heidemann » Wed 14. Apr 2021, 08:15

Hello,

Please have a look at the example 03_TIMER_IO, this example
uses a CAN-message to set the low side switch:

Code: Select all

// catch ID 334h to control the low-side switch
			if ( RxMsg.id == 0x334  &&  RxMsg.msgtype == CAN_MSGTYPE_STANDARD)
			{
				uint32_t  dig_out;
				
				
				// default OFF
				dig_out = 0;
				
				if ( RxMsg.data8[0] & 1)
				{
					// switch load to GND e.g. relay
					dig_out |= 1;
				}
			
				HW_SetDOUT ( &dig_out);
			}
			
			// forward message to CAN2
			CAN_Write ( CAN_BUS2, &RxMsg);
		}
For more information on the digital output please
have a look at the PCAN-Router FD documentation on page 32:

https://www.peak-system.com/produktcd/P ... an_eng.pdf

Best Regards

Marvin

Post Reply