Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Felix

Pages: [1] 2
1
MODBUS / Re: standalone Modbus
« on: March 10, 2018, 03:57:24 PM »
Hi Mark,

including the Modbus driver into FreeRTOS could be a good opportunity for us.
Can you explain that in more detail?
What is the "developer´s version"?
Is there any documentation about including utasker´s Modbus driver into an existing FreeRTOS project?

Best regards
Felix

2
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: February 04, 2018, 07:07:33 PM »
Hi Mark,

I think I almost have it now!  :D
You was right (again ;) ) with the short circuit (it was on the soldering) and I had to change some things in the example.
There´s some communication on all lines now and the slave answers at the given address. Unfortunately there´s still a little problem. How you can see in the attached image the master receives just semi-valid messages. Some bytes are not received correctly, but the Modbus settings on both devices are equal.
Can I fine-tune the timing somehow? Or maybe I'm still doing something wrong?

Best Regards
Felix

3
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: February 03, 2018, 08:45:52 PM »
Hey Mark,

I was right with my guess with the broken board. Now I have at least communication on the UART1 on the new board. RX and TX seem to be valid and RS232 should run now (can´t test it at moment).
But on RTS I´ve exactly the same signal like on TX, also with the same polarity. Changing MODBUS_RS485_POSITIVE to MODBUS_RS485_NEAGATIVE has now influence on this.
Do you know this hehaviour?

Regards
Felix

4
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: February 01, 2018, 07:47:02 PM »
Hi Mark,

as I already feared, this wasn´t my problem. I now have two mainboards on two different towers, one with TWR-SER and one with TWR-IND-IO with no modbus communication on neither if them.

Here my current setup for UART1:

TWR-SER:
J15, J17, J18, J19 - all set to 2-3
all other jumpers unconnected

TWR-K20D72M:
as new, but R35 populated

Primary Elevator:
B11 (PTE3/UART1_RTS) connected with B21 (ELE_RTS on TWR-SER)

TWR-IND-IO:
J8 connected to J20 (RX->RX; TX->TX; RTS->RTS)
all other jumpers unconnected

TWR-SER is connected via RS422 to USB
TWR-IND-IO via RS485(A/B) to USB
(I already tried different converter cables)

The firmware is the one from the repo with the above explained changes.

Do you see any difference to your setup which could have an influence here?
If not, could you maybe give me your test project to exclude any software issues.

Thank you again and best regards.
Felix

5
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: January 31, 2018, 06:54:37 PM »
Hi Mark,
I connected several UARTs, including UART2 via J20 and UART1 via J8 (it´s the same revision).

But there is another Jumper (J6) which connects 5V to the serial board so that the UART level at the controller is also 5V. This Jumper was set by default to 5V on my board (in contrary to the quick start guide). The k20 datasheet may say that 5.5 V is okay for IOs but who knows ...?!

Anyway I can´t communicate with any UART even the DEMO console doesn´t work anymore.
I ordered I new board and will give it a next try in a few days.

Thanks a lot for you help
Felix

6
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: January 31, 2018, 12:26:54 PM »
Hi Mark,

I double checked the connections. All three lines are connected between RS485 transceiver and uC via UART1.
On RX there´s some data transmission during polling. TX is permanently high and RTS is low.
I agree with you that the connection of the transceiver is similiar on both serial board, so in my opinion both of them should run with the right connection of RTS. Although I have no idea at the moment, I will give it another try later. Maybe I will look for another hardware.

Regards
Felix

7
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: January 30, 2018, 04:29:42 PM »
Hi Mark,

thank you a lot for checking this for me on your board. This is really great support!
But sorry, I still havn´t got it.  :-\
I prefer TWI-IND-IO because it has a half-duplex transceiver on it and I just have a two-wire converter. But I also tried the TWI-SER board. How do you connect the full-duplex board to the master? Do you have a 4-wire-RS485 to USB converter? I did´t find such a device. Do you think it could be okay to connect the positive and negative pins each togehter to get half-duplex transmission?

To my current issue: I think you´re right, that it has something to do with the RTS pin. I´ve now connected PT3 direct to the transceivers DE pin but there´s no signal (0 V) on it.
The above described toggling was on pin PTC7 which is defined as RTS1 on both serial tower boards. I´m a little confused about your explanation of the RTS pin connection.
On my board (TWR-K20D72M) there´s no 0R resistor on this path and PTE3 goes direct to the expansion header. I also did not find the descibed connection to PTC3 on the schematics.
By the way I soldered R35 on the mainboard to connect PTE0 as TX. UART1 (RTS,RX,TX) is now directly connected to the transceiver via expansion header.

In the original software I changed just the following things:
  • swap comments of #define FRDM_K64F and #define TWR_K20D72M in config
  • in config.h: uncommented USE_MODBUS
  • in app_hw_kinetis.h DEMO_UART from 1 to 0
  • in modbus_app.c: MODBUS_MODE_ASCII to MODBUS_MODE_RTU
                                                   
With an USB-to-RS485 converter I try to poll slave adresses 0 to 254 (19200 Baud) without any response and I can´t see any signal on RTS or TX.
Did I miss something or do I need a new mainboard? ;-)

Best regards
Felix

8
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: January 28, 2018, 06:34:24 PM »
Hi Mark,

thanks for your reply.
I´m pretty sure now, that it´s a software problem because I can run a self build application that is sending RS485 signals on the same hardware. The slave adress should also not be the reason because I use a master application on my PC which scans the hole adress range.
What I actually want to do is very easy: A single Modbus slave on UART1. 
I'm trying to get your initial example project to work as described in the Modbus user´s guide without any success.
The tranceiver (via UART1) on my TWR-IND-IO board gives some messages to the controller (RX) and there´s some toggling on RTS pin (200ms) but no response on TX.
What else should I take into account? Could some other code in the background affect the UART1 transmission or something like that? Do you maybe have example code for a similar configuration?
Hope you can give me a clue once again ;-)

Regards Felix

9
MODBUS / Re: Modbus RTU on TWR-K20D72M
« on: January 26, 2018, 08:01:20 PM »
Hey Mark,

Thank you for the fast response.
I can measure a valid RTU signal and RX is forwarded to the µC. But there is no reply on TX. If I put the DEMO UART on UART1 I can see messages on TX, so my hardware setup should be okay.
The Modbus channel is also selected as you mentioned and I don´t connect OpenSDA.
Is there any other software module which could block transmitting on UART1?

Thanks for your help and regards
Felix


10
MODBUS / Modbus RTU on TWR-K20D72M
« on: January 26, 2018, 05:17:03 PM »
Hi Mark,
somewhere on nxp.com you wrote, that the uTasker MODBUS module runs together with the NXP tower board TWR-K20D72M. This makes me hope, that you´ve already tried it with this hardware. It´s also supported in the code. How do you connect this board to RS485. I can´t get any connection to the board using TWR-SER or TWR-IND-IO serial modules. Maybe the reason for this could be, that the only UART with flow control between the boards is UART1 and this one is also used by the onboard OSBDM debugging circuit on the main board. Have you ever tried this combination with Modbus RTU?
If yes, maybe you can help me with my setup?!
Best regards Felix

11
µTasker general / Re: CAN bus on K20
« on: January 24, 2018, 12:41:24 PM »
Hi Mark,

I´ve found out that my issue has something to do with the way the acceptance mask registers are set in your code. For me, the following code called in fnConfigCAN (located in kinetis_CAN.h) is without effect:
Code: [Select]
if (ptrFirstAllocated == ptrMessageBuffer) {
                    ptrCAN_control->CAN_RX15MASK = pars->ulRxIDMask;     // first allocated receiver buffer has special mask
                }
                else if (ptrSecondAllocated == ptrMessageBuffer) {
                    ptrCAN_control->CAN_RX14MASK = pars->ulRxIDMask;     // second allocated receiver buffer has special mask
               }
                else {
                    ptrCAN_control->CAN_RXGMASK = pars->ulRxIDMask;      // initialise general acceptance mask for use with subsequent buffers
                }

If I call the same code within the fnInitCAN function, everthing works as expected. I do not really understand why it has to be called from there, because both functions are called one after another. Maybe you have an idea ?!

In my case, I'm now very happy with my great working CAN interface.  :)

Thank you and best regards
Felix

12
MODBUS / standalone Modbus
« on: January 21, 2018, 10:27:16 AM »
Hey Mark,

in the Modbus User´s Guide you wrote, that one can include the Modbus source files into any project. Is it easy to integrate it into own projects (without uTasker)? How do I need to prepare my project to add those files. Do I need aditional recources (Timers etc.)?
Do you have example code for using modbus without uTasker for Kinetis?

Thanks for your help and regards
Felix

13
µTasker general / Re: CAN bus on K20
« on: January 12, 2018, 06:11:31 PM »
Hey Mark,
thanks for the hint with the RX mask, but changing
tCANParameters.ulRxIDMask = 0x7FF to
tCANParameters.ulRxIDMask = 0x000
in can_tests.h is without any effect for me. It´s still just one ID that passes the filter.
In my application I dont`t need filtering so the default settings in CAN0_CTRL2 should be okay.
Sorry but I'm not that  familiar with the code yet, to understand what I´am doing wrong.
Cheers Felix

14
µTasker general / Re: CAN bus on K20
« on: January 12, 2018, 02:17:31 PM »
Hey Mark,

CAN bus is now working in both directions via terminal debug interface.
My problem is now that receiving of CAN messages is limited to one single ID, defined as tCANParameters.ulRxID in can_test.h.
In the CAN user manual you wrote, that the usage of mask bits is also possible but hardware specific:
Code: [Select]
tCANParameters.ulRxIDMask = CAN_STANDARD_MASK;This doesn`t work for me, at least for the terminal debug interface.
Can I use CAN receiving just for one ID for my hardware (TWR-K20D72M) or is this just an issue of the can test functions?

Thank you and best regards
Felix

15
µTasker general / Re: CAN bus on K20
« on: January 11, 2018, 08:26:13 AM »
Hey Mark,
thank you. You gave me the right approach. It was about a wrong path configuration in my project. Now the menu entries are shown.
Best regards!

Pages: [1] 2