Connect with us

Using UART with a Fujitsu microcontroller

Discussion in 'General Electronics' started by Susanne Fischer, Jun 7, 2004.

  1. Hi!

    I have a MB90F347 microcontroller from Fujitsu and am trying to
    communicate over UART. Everything works fine, if I transmit only
    values from 1 to 255. But I'm not able to send a 0 (0x00).
    I really don't understand why this doesn't work. Also in the hardware
    manual and in the application notes I can't find any hint on that.

    ....
    // initialize UART0
    BGR0 = 1666; // 9600 Baud @ 16MHz
    SCR0 = 0x17; // 8N1
    SMR0 = 0x0d; // enable SOT3, Reset, normal mode
    SSR0 = 0x00; // LSB first
    ....
    while (SSR0_TDRE == 0); // wait for transmit buffer empty
    TDR0 = 0x01; // this works fine

    while (SSR0_TDRE == 0);
    TDR0 = 0x00; // nothing happens here... WHY?
    ....



    Thank you very much for your help in advance,
    Susanne Fischer
     
  2. What, exactly, do you mean by "nothing happens"? Are you 'scoping the
    output, or are you waiting to see something at the receiver? If it's the
    latter, are you sure that the receiver isn't simply seeing an all-zero byte
    as 'break' and throwing it away?

    Steve O'Neill
     

  3. Now I found the problem. My terminal software on the PC side doesn't
    show the 0x00 (maybe it looks as if the receiving buffer is empty?).
    I also had some hardware problem which made the zero never arrive at
    my receiver (different GND potential on my PC and battery-driven robot
    which made it not work).
    Now I made everything battery-powered and everything works fine!

    Susanne Fischer
     
  4. Quack

    Quack Guest

    Now I made everything battery-powered and everything works fine!

    You ran your computer on batteries ? :)
    wouldnt it be easier to just connect gnd.

    I had a similar problem before, but the other way around. Very few
    emulation software allowa you to send 0x00.
     

  5. First I used a microcontroller connected to my PC and to a robot
    (using two UARTs). There only the robot was battery-powered.
    And I did connect GND. The problem was, that there still was a high
    enough current when everything should be off. So e.g. the motors
    always ran...
    This problem disappeared when I connected the microcontroller to the
    robot batteries and ran my program only there (without the PC being
    connected to the whole thing). Somehow strange, but that's the way it
    works now.

    I use a very good freeware terminal program called SuperTerm (at
    www.mpfreezone.com). You can do everything with it really simple. Also
    send strings or bytes (also the 0x00). It also shows the received
    hex-values (not only characters as all the others). Only
    receiving/showing the 0x00 doesn't work.


    Susanne Fischer
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-