Need Help Designing a Circuit

Discussion in 'The Projects Forum' started by eyik66, Dec 16, 2012.

  1. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    I only need general information, and the application is universal, so please don't close this thread. This is a learning opportunity for many people to come. I am working on a project that needs to do the following:

    1. Read serial data that is being sent by a device, store the values, change two of the values, and then send the revised data to a different device.

    2. It may be necessary for the device to output at a faster rate than the input (output 5 times for every 1 time the serial input is received). The values that are being changed in step 1 are from a device that has a rapidly changing value. It is ok if the other values are not refreshed and are older than the revised values.


    Can someone point me in the right direction on what type of circuit would be capable of achieving this?

    Also, I need to start "seeing" the data being sent with the device. How does one "intercept" the serial data and start sorting and manipulating it? I have been reading about a "sniffer" program. Am I on the right track?

    Thanks for the help!
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You need to be way more specific with your question...

    What serial protocol are you talking about here? SPI? I2C? UART? Asynchronous or synchronous?

    What are your transmission speeds? You mentioned that Tx has to be 5x Rx, but what speeds are we talking about?

    What is preventing you from manipulating the data from wherever the data is coming from in the first place? Do the two values change the same way every time, as in XOR the values together?

    Without knowing anything more about your circuit or requirements, I'd say look into FPGAs, they are fast and can do pretty much anything you might require.... Or use a , CPLD, as this is generally a lower cost than a FPGA with a lower logic density than FPGAs.
     
  3. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    sorry I don't know a lot about this stuff so I'll dig some more. The CPLD is a good start, I really just needed to be pointed in a direction so I can come back with some good questions. Are these devices programmable in a language like C?
     
  4. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    CPLDs and FPGAs are usually programmed in verilog or vhdl, which is a lot different from any standard programming language.
    I think a microcontroller would be better suited and simpler to get it done, but wihtout further info its just guessing, so please answer all the questions that tshuck asked you.
     
  5. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    Is a microcontroller programmed in a language I would be familiar with like C? I'll get the info together today. Thanks for the help everyone.

    To answer a few questions:

    I have no control over the unit sending the data. I don't know how to reprogram it, and I'm guessing it would be impossible to do. I want it to send different information to the receiving unit, but I have no idea how I could program that. I only have the .BIN which is in HEX and I can make very little sense of it. It seems like the fastest solution would be to intercept the signal, and then make the changes I want, and then pass the data on.

    No, the two values are going to be given as a voltage (0-5v) which are read from two sensors
     
    Last edited: Dec 16, 2012
  6. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Yes probably all microcontrollers can be programmed in C.
     
  7. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Kubeek makes a point, however, without knowing your timing requirements, we have no idea if a microcontroller would work for you. How fast is the data being generated and transmitted?

    Serial data tells us very little about your setup. Serial data simply tells us that data is being brought into the processor one bit at a time. This doesn't tell us the format of how the data is being transmitted.

    Also, your values, how many bits wide are they?

    Probably not. You need to help us help you if we are to answer this question.
    A common way to do this would be to use a UART to USB module to print values from the controller to a terminal program(like Hyperterminal, Teraterm, PuTTY, etc.) on the computer.

    How many wires are required for this interface?
     
  8. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    The serial data is transmitted on a single wire


    It appears that the protocall is very similar to j1850 (this is not an automotive project). I was told the following by someone who is helping me:

    It appears that the average Bus speed is around 10.4 KBS

    The maximum message length is 12 bytes
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    So sounds like a ODB reader? ;)

    Anyway, from what you are telling me, it sounds like you are going the VPW route for transmission. From the wikipedia article on ODB:
    If this is the case, a uC can do what you want. I'm not familiar with the standard, but from what I understand, you could determine data based off of the length of the pulse. You could use a external interrupt pin to detect when a transmission is detected and start a counter to determine how long the pulse is present.

    As far as seeing the data on the bus, you could get a uC with a UART and push the data out over the UART each time a message is received, which could be displayed using a terminal program, as I described before.

    Since this is probably a fairly noisy environment, remember, Schmitt triggers are your friends...
     
  10. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    can you shoot me an email? <SNIP>
     
    Last edited by a moderator: Dec 18, 2012
  11. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    I.....I...uh... don't do the sex-chat thing.....



    Seriously, though, I'd like to keep the thread going...
     
    Last edited by a moderator: Dec 18, 2012
  12. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    haha, ok. Well its not an OBD scanner that I'm working on, I've already got one of those. Here is some more info:

    The starting point (Device #1) is a computer. That computer is sending out values from several sensors. I cannot reprogram that computer easily.

    The data is then sent to a module, which has an LCD screen that displays the values of the sensors.

    I am trying to replace two of the sensors in the system, and have all sensors displayed on the same LCD. Since I can't reprogram the source, I feel that the data needs to be intercepted, modified, and then sent to the LCD screen. If your previous suggestions still apply, I will do some homework, and come back with some results to debug the system.
     
  13. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Yes, the previous suggestions still apply.

    A uC should be able to do what you need, though, the interceptor now becomes the LCD driver, so be sure you can drive the LCD properly with the uC you choose and can meet any timing requirements on the LCD module.
     
  14. eyik66

    Thread Starter Member

    Dec 15, 2012
    30
    0
    Is it necessary to make the uC the LCD driver? I would hope to not make any physical changes to the end device. I am hoping the end device will receive the data and sort it unaware of the changes and display the new data values. I might make some changes to the end device (in the eeprom) to change the units for the data. I assume that is where the information is held?
     
  15. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Really, it depends on your system. The sender may be keeping to an update schedule to drive the LCD, and, if that's the case, your controller needs to meet those requirements. It just as well, may not have timing requirements. Some LCDs require specific timing, others accept serial data and is displayed through an on-board controller.
     
Loading...