Author |
Message |
Topic: Setting up RS-232 with variables from program |
Dutch Guy
Replies: 3
Views: 15000
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2021 2:22 pm Subject: Setting up RS-232 with variables from program |
PIC18F8722
CCSC 5.074
Greetings,
I need advice on how to setup a rs232 stream using variables from my program.
I have an initial
#use rs232(baud=MODBUS_SERIAL_BAUD, UART1, bits=8, stop ... |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sun Apr 19, 2020 7:05 am Subject: atoi(*s) pointing to where? |
Its working fully now.
My end question is : What would be best ?
- First checking for last 4 digits to be under the +276-278 range and checking the 5th digit for being 3 or lower before feeding th ... |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sun Apr 19, 2020 6:44 am Subject: atoi(*s) pointing to where? |
And it got completely clear now I see that int result variable in itoa is only 8-bit.
I_to_l it is. Flips at 128
Switching between int definitions and processors will keep haunting me. |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sun Apr 19, 2020 5:52 am Subject: atoi(*s) pointing to where? |
Yes Ttelmah you are right again. My itoa is failing because of something else. I just discovered that the mouseover results in decimal values. I really got fixed on this as being an error.
Thanks |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sun Apr 19, 2020 5:33 am Subject: atoi(*s) pointing to where? |
Not slapping myself yet
The device I'm using is a Clicker 2 board with a 18F87J50. I got tempted to use the ATOL() even with the 8 bit device. I was trying to check the number being in the -32768- ... |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2020 4:50 pm Subject: atoi(*s) pointing to where? |
This is the weirdest thing I saw in a while.
How can I post the printscreen png of my environment with watch windows and mouseover?
If I see mouseover 's' as 0x02B5 and I look at the file registe ... |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2020 4:38 pm Subject: atoi(*s) pointing to where? |
Thanks for the interest again Ttelmah.
I did shorten the posted code. The begin_char_pointer is loaded trough the function parameters in which itoa is used. While debugging it loads s in stdlib.h as ... |
Topic: atoi(*s) pointing to where? |
Dutch Guy
Replies: 11
Views: 31734
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2020 1:25 pm Subject: atoi(*s) pointing to where? |
CCS C v5.074
#include <18f87J50.h>
#fuses NOWDT,PLL3,NOCPUDIV,HSPLL,NOXINST
#DEVICE PASS_STRINGS=IN_RAM
When atoi(string_pointer) is called the pointer address gets transferred correct ... |
Topic: Immediate iterations of USB_cdc_puts() need delay? |
Dutch Guy
Replies: 8
Views: 18239
|
Forum: General CCS C Discussion Posted: Mon Apr 13, 2020 4:33 pm Subject: Immediate iterations of USB_cdc_puts() need delay? |
So if I understand correctly USB_cdc_puts marks the buffer as filled for 64 bytes and is free to write when 64 bytes are free again even when not fully filled with chars. Like a roller coaster that is ... |
Topic: Immediate iterations of USB_cdc_puts() need delay? |
Dutch Guy
Replies: 8
Views: 18239
|
Forum: General CCS C Discussion Posted: Sun Apr 12, 2020 3:28 pm Subject: Immediate iterations of USB_cdc_puts() need delay? |
Thanks for the quick responses.
The two strings I tested with were : "Incoming" and "link", two small strings I suppose. My buffers are all 64 byte.
Weird that these should not ... |
Topic: Immediate iterations of USB_cdc_puts() need delay? |
Dutch Guy
Replies: 8
Views: 18239
|
Forum: General CCS C Discussion Posted: Sat Apr 11, 2020 4:38 pm Subject: Immediate iterations of USB_cdc_puts() need delay? |
I just started to use the USB hardware since I switched to a clicker2 board with the 18F87J50.
After a struggle that lead to defining #use delay(clock=48MHz, crystal=8MHz, USB_FULL) in stead of #us ... |
Topic: Modbus interfacing with PC |
Dutch Guy
Replies: 11
Views: 24748
|
Forum: General CCS C Discussion Posted: Thu May 03, 2018 3:31 am Subject: Modbus interfacing with PC |
Hemnath
You must not be using the driver like that.
When data comes in the serial buffer the rx.struct (received data) will be analyzed by the driver and this will decide to do something according ... |
Topic: Modbus interfacing with PC |
Dutch Guy
Replies: 11
Views: 24748
|
Forum: General CCS C Discussion Posted: Wed Mar 28, 2018 6:27 am Subject: Modbus interfacing with PC |
I just wrestled through the example modbus slave and got my pic modbus PLC working with 32 inputs and outputs.
A great tool for checking data while debugging is Realterm. Once your RS485 cables are ... |
Topic: Weird consistent values in modbus_rx struct |
Dutch Guy
Replies: 11
Views: 22056
|
Forum: General CCS C Discussion Posted: Thu Mar 22, 2018 10:40 am Subject: Weird consistent values in modbus_rx struct |
I found my problem thinking "inversion" and YES...
When I switch AB transmission lines it works correctly.
Strange.. the Moxa converter is labled A RTS- and B RTS+, the click 2 board from ... |
Topic: Weird consistent values in modbus_rx struct |
Dutch Guy
Replies: 11
Views: 22056
|
Forum: General CCS C Discussion Posted: Thu Mar 22, 2018 10:29 am Subject: Weird consistent values in modbus_rx struct |
It is the J and K type with LV compatibility that have the 16 Mhz. I`m using the 5V one :18F8722 |
|