UART Channel8 PE-HMI1

Hi,

I am using the PE-HMI1, when I setup the system to use the "green" connector where the RS232/485/422 system runs on "channel 5" as RS232, all works fine.

However on the PMOD-A pins 2,3 and 5, TXD8, RXD8 and ground, and change the setup in the code to use channel 8 for UART, then I still receive my data, but now it is 2's complimented and sent in little-endian, I think, in other words reversed.

So lets say I send a byte - 0x02, this would be 0000 0010,

but on my receiving device (PC) I have received 1011 1111 (0xBF),

I saw in the S7G2 Manual that you can change the mode of transfer from LSB to MSB ect, but cannot find how to do this on the framework config, can someone please assist in getting this to work for me.

  • Are you using an RS-232 transceiver (level shifter) when using PMOD-A?
  • In reply to Jeremy:

    Hi, thanks for the reply, but no, I have actually taken the connector wires and connected them directly to a RS232 port on the PC, and yes I have used the exact same thing when using the "green" can connector port, so the only thing changing is the wires from the can connector to the PMOD-A, and it gives me this issue, I have also tested it with different values not just the 0x02, noting this only for informational reasons, the issue is as described, when I use the can port, it works, when I use the PMOD-A it does not, I have also tried the PMOD-B port and same issue, so I am assuming that the issue is the RS232/485/422 IC, that runs the can port, but I cannot see how that device will cause a reverse AND invert the bit values....

    Also just want to note, I am not new to micro-controllers, so yes I am aware that for final product I cannot take the PMOD-A/B wires directly to a RS232 port, as its not a 5V system but a 13V system and that I should use something like a MAX232 IC, but for testing I am 100% sure the max232 will not reverse the data and switch the bit values back as I have done this before in testing environments, since all I am doing right now is writing my protocol format....

  • In reply to Ghost:

    When you take a look at the schematics you will see that UART5 uses an Intersil transceiver (ISL41387) while UART8 does not have any transceiver. For UART8 you have to add the transceiver yourself.
  • In reply to FrankL:

    Yes, I am aware of that, but all the transceiver will do is change the voltage from 3/5VDC signal to a 13VDC swing signal, which is the RS232 signal, it will not however reverse the order transmitted and will definitely not reverse the bit(negate it) values.

    If the S7G2 UART ports do that by default and the ISL41387 will correct this, then I have a massive issue with the S7G2, since the UART standard used on all "micro-controllers"(Microchip PICS) that I have work on, and interfacing components, dont do this.

    So that would tell me that if I where to connect a SN75176B to the UART port the data would be reversed and bit negated, as the SN75176B is a standard RS232 to RS485 driver, and I somehow doubt that Renesas has designed there micro-controller to work like that, I do however think there is a setting in the S7G2 that will do this, since is says so in the manual, you can change it to transmit and receive either LSB or MSB first.

    1. I cannot find in the manual where is says it will negate(switch) the bits value's.
    2. I cannot figure out where in the framework to change the direction of transmit from MSB to LSB.

    Now I am not trying to sound arrogant, if so then I apologize, but I do think I am missing something simple, I don't however think its a component like a "special" transceiver, as this would mean the issue is in the S7G2, which should then be documented somewhere and I cannot find anything on google or Renesas.
  • In reply to Ghost:

    When you change all initialization instructions from UART5 to UART8, it is unlikely that UART8 uses a different data format.
    Have you checked that all initialization instructions go to the correct registers? Do you see that UART5 and UART8 registers are initialized with the same values?
  • In reply to FrankL:

    The only thing I change is in the config, and I change the channel from 5 to 8, I also go to pin config, and make sure UART 8 is setup the same as UART 5, both peripheral and pins, that way my code wont change as it initializes the UART 5 correct, so if I change the channel then thats all that should matter, hence I think its something simple, I know that you thinking in the line of hardware as by that definition the software has not changed, only the channel, so I must agree with you its hardware, but I have gone over the ISL41387 datasheet and that device does not by any means change the data in the way that its happening.

    I cannot give you my code right now, but I will start a new project with just those functions for the PE-HMI1, I will make sure it is setup identical as that is not hard, then I will post the project and if you have access to a S7G2 testing device with those pins you are welcome to test and see the results I get, that will also be a test for me to make sure I am not causing the issue somewhere else.

    I will only be able to post this tomorrow, but I would appreciate a Renesas response in the mean time if there is someone that can respond, but if not then I will have the code posted tomorrow for anyone that wants to test.
  • In reply to FrankL:

    Will check the registers tomorrow as I am not working on the system today, busy with a different system today and will continue on this project tomorrow morning
  • In reply to Ghost:

    This is in reply to FrankL and Jeremy,

    Thank you so much for your assistance, I would like to state, that I was 100% sure that in a test environment one would not need the RS232 Transceiver device, but I appear to have been proven wrong by these 2 GREAT gentleman, back to Electronics 1 for me again I guess.

    I have made a small PCB with MAX232 on it, and connected the pins from PMOD-A to the device and connected that to the RS232 PC Port and all is working 100% correct now.

    Thank you so much for the responses.

    PS. when you think you are right but its not working, chances are you could be wrong.....