View Feed
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12796 Members
Join this group to post and comment.
chrisall • Jun 16, 2008

Send 12v Serial Data from PIC to ECU

I have a device that sends a stream of data to an ECU. The data is NOT RS232, it is simple async 8N1, with a logic '0' represented by 12v and a '1' = 0v.

What I wish to do is emulate this device using a PIC, but be able to send the ECU any hex word I choose. For testing purposes I have been playing with the following, in an attempt to do this:

For sec_code = 65535 To 0 Step -1
Print At 1, 1, Dec sec_code
Print At 2, 1, HEX sec_code
RSOut HEX sec_code
DelayMS 10

I've tried this at 300baud 8N1, inverted. The 5v output from the pic I've used to trigger an opto, which then switches the 12v sent to the ECU input.

But I can't seem to make the ECU respond to my data. (Surprisingly enough).

Any ideas / suggestions on how to convert the 5v serial data O/P from the PIC into the 12v input that the ECU needs?


reachrkata • Jun 19, 2008
Hi Chrisall,

The simplest way I would say is to use a rail-to-rail Opamp in comparator configuration. Connect V+ to 12V, V- to 0, In- also to 0 and finally IN+ to the 5V serial data.
This should do the trick.


Share this content on your social channels -