Forum Discussion
Altera_Forum
Honored Contributor
13 years agoSingle wire can bus and bidirectional pin coding
Hi all, I am a beginner, trying to implement a One-wire CAN bus coupler logic on a Cyclone IV FPGA. The FPGA communicates to a disconnectable external slave device via a pin using CAN bus...
Altera_Forum
Honored Contributor
13 years agoI have some queries on bidirectional port as per the code is in post# 1.
Is it possible receive data from the slave without driving the bidirectional port with 'Z' on the master side? What I am trying to do here is: 1. The slave replies with a '0' bit on the bidirectional line to acknowledge data received. The port works fine when its configured as input port (bidir <= 'Z') but when its bidirectional, I cannot get the response from the slave. My guess is because register 'A' is driving register 'B' high, while the bus is '0' This is the RTL representation of the bidir port in Quartus: https://www.alteraforum.com/forum/attachment.php?attachmentid=7739 I tried to use something similar to the below code to replace the bidirection portion of the bidir_port:
bidir <= '0' when output = '0' and else 'Z';
however the waveforms from the pin appear distorted for some reason. The pin cannot be driven high. I need to investigate this further. For now I can only switch the port permanently as an input port an use another pin to drive the bus with the output to the slave.