Solved
The cabling was the problem, it was always tied to ground. After fixing cabling then works as intended.
//Emil
Search found 3 matches
- Wed 8. Jan 2025, 14:49
- Forum: PCAN-Router FD
- Topic: Reading DIN0
- Replies: 4
- Views: 6773
- Wed 8. Jan 2025, 12:51
- Forum: PCAN-Router FD
- Topic: Reading DIN0
- Replies: 4
- Views: 6773
Re: Reading DIN0
Hi!
Have had winter holidays now back to this problem.
I'm assigning diStatus to zero at initialization, then in the while loop HW_GetDIN is called and address of diStatus is sent as an argument to the HW_GetDIN function.
This to me should give me the current status of DIN into the value of ...
Have had winter holidays now back to this problem.
I'm assigning diStatus to zero at initialization, then in the while loop HW_GetDIN is called and address of diStatus is sent as an argument to the HW_GetDIN function.
This to me should give me the current status of DIN into the value of ...
- Fri 20. Dec 2024, 13:52
- Forum: PCAN-Router FD
- Topic: Reading DIN0
- Replies: 4
- Views: 6773
Reading DIN0
Hello!
Trying to read the DIN0 with the PCAN-Router FD with the following code.
// variable for storing Digital Input
uint32_t diStatus = 0;
In int main function
// check digital input and send out status on CAN
HW_GetDIN ( &diStatus );
din0 = (diStatus >> 0) & 1;
This always gives me a zero ...
Trying to read the DIN0 with the PCAN-Router FD with the following code.
// variable for storing Digital Input
uint32_t diStatus = 0;
In int main function
// check digital input and send out status on CAN
HW_GetDIN ( &diStatus );
din0 = (diStatus >> 0) & 1;
This always gives me a zero ...