Search found 128 matches

by George_B
Thu Mar 18, 2021 10:28 am
Forum: 8-Bit PIC
Topic: convert two Int to one Float
Replies: 7
Views: 9150

Re: convert two Int to one Float

Hi Steve, thanks for the reply and help. I am using Flowcode 7, at the moment i can not use FC8. I thought it would be easy somehow to implement this conversion using C code. I have seen this post with 4 bytes but i could not figure out any result since in my case i need to use two integer values. R...
by George_B
Thu Mar 18, 2021 10:01 am
Forum: 8-Bit PIC
Topic: convert two Int to one Float
Replies: 7
Views: 9150

Re: convert two Int to one Float

Hi Stafan, nice to hear from you. Maybe i was not describe the issue with details. In Modbus, when you define the address you read as float type, it will automatically read two addresses with one integer on each address in order to obtain the float value. For example: If you want to read the registe...
by George_B
Thu Mar 18, 2021 8:15 am
Forum: 8-Bit PIC
Topic: convert two Int to one Float
Replies: 7
Views: 9150

convert two Int to one Float

Hello to everyone ! In modbus, sometimes, we need to obtain float variables to describe a value. As i have understand so far there will be need to send two integer variables in order to describe this float variable. My question is, if i have a float variable = 24.256, how it is possible to split tha...
by George_B
Wed Mar 17, 2021 9:06 pm
Forum: Flowcode V6
Topic: Float Calculation
Replies: 6
Views: 9524

Re: Float Calculation

Hello to everyone ! I know this is an old post but lets take it a little bit further. In modbus, sometimes, we need to obtain float variables to describe a value. As i have understand so far there will be need to send two integer variables in order to describe this float variable. My question is, if...
by George_B
Tue Mar 16, 2021 12:43 pm
Forum: 8-Bit PIC
Topic: Getting Error when using UART on 16F1825
Replies: 2
Views: 3121

Re: Getting Error when using UART on 16F1825

Hi Benj,

Great job!
You gave the solution fast and sharp as always, now it is working perfect.


Thank you very much!
George
by George_B
Tue Mar 16, 2021 11:04 am
Forum: 8-Bit PIC
Topic: Getting Error when using UART on 16F1825
Replies: 2
Views: 3121

Getting Error when using UART on 16F1825

Hi, i am trying to use UART with device 16F1825 and i am getting the error below. When i remove the UART components from the project, it compiles with no errors. I would like to configure the uart so i can set the baud rate value at 1200 using C code. is there anyone how faced the same issue? Thanks...
by George_B
Wed Feb 10, 2021 11:34 am
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

worked fine!


Thanks Again Stefan, i hope one day i can "payback" this to all you guys.
by George_B
Wed Feb 10, 2021 11:09 am
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

medelec35 wrote:
Tue Feb 09, 2021 8:36 pm
Hi George,
How about

Code: Select all

BAUDCONbits.BRG16=0;
?
Hi Martin and Stefan

no luck with this code, i am getting error on C code again. :(
Screenshot_3.jpg
Screenshot_3.jpg (27.2 KiB) Viewed 9998 times
by George_B
Tue Feb 09, 2021 10:52 am
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

Hi Stafan, thank you once again for helping me out.

I got this error after compiling with the code you provided.

I am looking the datasheet so i can familiarise myself and learn about it.
Screenshot_2.jpg
Screenshot_2.jpg (20.63 KiB) Viewed 10034 times
Regards
George
by George_B
Tue Feb 09, 2021 9:58 am
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

Hi again, In my previous posts, with the help of Stefan, i manage to set the baud rate at 1200 on a 18F4680 device. I am trying to set the same baud rate value on a 16F88 device but i am getting an error for the C code. Should i use any other code than this i used for 18F device? Thanks George
by George_B
Fri Dec 18, 2020 8:22 pm
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

Thanks to Stefan i manage to have the program working at 1200 baudrate.

The trick was to change( use grater than 1) the timeout value from UART Receive component.



I wish you all be well and health.


Regards
George
by George_B
Fri Dec 18, 2020 6:03 pm
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

ok the compile to hex now does not returns any error. However the MCU is only sending data out(correctly at 1200 baud rate) and not receiving data .Note that i am using Rx INTerrupt to read the incoming data.

Is there anything else i have to configure to have it working ?


Thanks
George
by George_B
Fri Dec 18, 2020 4:33 pm
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

Hi Stefan, Thanks for your help. I tried to add the C code (4 lines you mentioned) but i get an error(see attachment). Sim_Error.jpg I am using 19.660800 Mhz Crystal and i want to set the baud rate value at 1200. As far as i read in the manual i can only calculate the value of SPBRG. The formula i u...
by George_B
Thu Dec 17, 2020 10:10 pm
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Re: Low Baud Rate speeds- How to set up using C code

Hi, i tried to use the lower values baud rate but it is actually not working on hardware. There should be something missing in the flowcode's background..

Hopefully someone will answer to this and solve the issue.



Regards
George
by George_B
Thu Dec 17, 2020 9:50 pm
Forum: Flowcode V7
Topic: Low Baud Rate speeds- How to set up using C code
Replies: 15
Views: 10351

Low Baud Rate speeds- How to set up using C code

Hi all! I hope you are all well. My question is (as the title says) how to set up lower baud rate speeds than 9600(flowcode default) using C code for device 18F4680. I would like to be able to use baud rate values of 1200 , 2400 and 4800. It is not very clear to me what is the way we calculate and c...
by George_B
Fri Feb 15, 2019 2:52 pm
Forum: Flowcode V7
Topic: Interrupt on INT0 pin - How fast an interrupt can capture external pulses
Replies: 9
Views: 5487

Re: Interrupt on INT0 pin - How fast an interrupt can capture external pulses

Hi George, I was a bit confused by your flowchart. The INT0 interrupt for encoder detection is RB0. So if you look at the input within RB0 call macro you will see there is an input for E0. The input should be for RB0 instead. I'm therefore surprised the encoder works at all? Hi Martin , The encoder...
by George_B
Fri Feb 15, 2019 2:47 pm
Forum: Flowcode V7
Topic: Interrupt on INT0 pin - How fast an interrupt can capture external pulses
Replies: 9
Views: 5487

Re: Interrupt on INT0 pin - How fast an interrupt can capture external pulses

Hi It seems you are runing an motor with an encoder attched. What is the max speed of the motor ? and at what speed do you start to loose to detect encoder pulses? The encoder at the moment is not attached on the motor. The encoder movement is done by hand and the rotation speed is approximately le...
by George_B
Fri Feb 15, 2019 1:20 pm
Forum: Flowcode V7
Topic: Interrupt on INT0 pin - How fast an interrupt can capture external pulses
Replies: 9
Views: 5487

Re: Interrupt on INT0 pin - How fast an interrupt can capture external pulses

Hello all, thank you for your replies.

here is the flowchart so you can see the actual code.

Just note that the crystal speed is 19.6608 Mhz and not 20Mhz as i said in my previous post.


Waiting your comments.


Best Regards
George
by George_B
Thu Feb 14, 2019 1:40 pm
Forum: Flowcode V7
Topic: Interrupt on INT0 pin - How fast an interrupt can capture external pulses
Replies: 9
Views: 5487

Interrupt on INT0 pin - How fast an interrupt can capture external pulses

Hello all! I am using an encoder with A and B signal outputs. I also use an interrupt macro for INT0 (RB0) pin of a 18F4523 microcontroller with 20Mhz external crystal. The encoder has 250 ppr. I am wondering if there is any way of capturing the encoder's pulses faster? At the moment i rotate the en...
by George_B
Fri Dec 14, 2018 10:25 am
Forum: Flowcode V7
Topic: Modbus RTU RS485 - Receiving Issue
Replies: 6
Views: 5066

Re: Modbus RTU RS485 - Receiving Issue

Hello Benj, thank you for your reply. I am still trying to communicate with the Power Meter with no luck. The simulation in Proteus gives me correct results but in real hardware there is a problem in the reception of the Power Meter data. The attached File "Modbus_RTU" (Flowcode 7 Version) shows the...
by George_B
Tue Dec 11, 2018 11:02 am
Forum: Flowcode V7
Topic: Modbus RTU RS485 - Receiving Issue
Replies: 6
Views: 5066

Re: Modbus RTU RS485 - Receiving Issue

Hello, i manage to request the data correctly from Power Meter.

Now the issue that i am facing is regarding the receiving data using 2 stop bits.

Is there any idea how to achieve this? I am using Rx interrupt to receive the incomming data.


Thank in advance!

George
by George_B
Thu Nov 01, 2018 9:18 am
Forum: Flowcode V7
Topic: Modbus RTU RS485 - Receiving Issue
Replies: 6
Views: 5066

Re: Modbus RTU RS485 - Receiving Issue

Hello Benj, thank you for your reply. I am still confused and wondering how to receive and handle the incoming data from modbus slave. Using Modbus Poll software i managed to communicate with the slave device and get the expected data.(see pictures) The only options in flowcode for getting data thro...
by George_B
Tue Oct 30, 2018 8:02 pm
Forum: Flowcode V7
Topic: Modbus RTU RS485 - Receiving Issue
Replies: 6
Views: 5066

Modbus RTU RS485 - Receiving Issue

Hello, i hope you are all good! I have to read a power meter (Voltage - Amperes - Watts etc.) using Modbus RTU. In order to get some level of experience and understand things better, i first installed a modbus terminal software to observe the communication structure. I understand a few things and i ...
by George_B
Mon Oct 08, 2018 9:50 pm
Forum: Electronics products
Topic: RS485 Battery Stack and Common Ground
Replies: 13
Views: 16602

Re: RS485 Battery Stack and Common Ground

:D I made a mistake when i was drawing the schematic.. I already replaced the pdf file with the correct version.


Is there any opinion about this circuit? Will this be working properly? Any idea? :roll:
by George_B
Mon Oct 08, 2018 11:24 am
Forum: Electronics products
Topic: RS485 Battery Stack and Common Ground
Replies: 13
Views: 16602

Re: RS485 Battery Stack and Common Ground

Hi all, Leigh thank you for your drawing. I am working this project in my mind and to be honest i can't see the reason for not connecting each microcontroller across each battery without any isolation circuitry. The ADC of the Micro will go at the positive of each battery and the ground pin of the M...