sending numbers over Rs232

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times
Contact:

Re: sending numbers over Rs232

Post by Xavier »

Hi Martin

Sorry for being away for so long but had a bad case of chemotherapy but all is well now so i'm :D again (till the next bad one) any ways I got all the code working just like I wanted it to and i must say that I'm quite pleased with it, however I have come up against an obstacle and I have to say that I don't have a clue how to get around it. In order for things to work the to pic's need to run at the same frequency but what I did when I started to write the code was to leave the second pic on the internal oscillator of 4Mhz as I did not have an 8Mhz crystal for the first pic I used a 4mhz instead, problem now is that I would like to have them both running on a 20Mhz crystal as I need more speed for the sampling. If I try to place an interrupt in the RX code it starts to do everything that it should not be doing. I have attached both the files that are working but only with the 4Mhz configuration, would you mind having a look at it? as I said the problem file is the RX the TX has a crystal in it.

All the very best
Xavier
Attachments
16f690_Detector1_TX.fcf
Here I used a crystal because timing is critical
(57.64 KiB) Downloaded 235 times
16f690_Detector1_RX.fcf
This is where I never thought of using a crystal (a very stupid mistake)
(33.54 KiB) Downloaded 231 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: sending numbers over Rs232

Post by medelec35 »

Hi Xavier,
sorry to hear that you have not been well. :(
So it looks like you're going the control byte then data which does make sense.

As for using 20MHz, all you do is set oscillator to HS (configuration settings) and set the clock speed to 20000000.
With RX interrupt, you can't have the LCD macros within it otherwise there will be corruption issues.
So within the RX interrupt macro, you just need update = 1
Then in main you need a decision branch if update = 1 then update=0: call coms macro.
If you give that a try then I can take another look at it for you.

One thing I would recommend is right click RS232 on your panel and change Display characters from characters to bytes:
RS232 Prop1.png
(86.86 KiB) Downloaded 2083 times
Then you can see actual numbers sent, rather than asterisks

Martin
Martin

Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times
Contact:

Re: sending numbers over Rs232

Post by Xavier »

Cool thanks Martin I'll give it a go, may take me a while though LOL will get back to you no mater what.

Best regards
Xavier

Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times
Contact:

Re: sending numbers over Rs232

Post by Xavier »

Well I thought that I followed all the steps to the letter but it seems that I did a boo boo LOL
Attachments
16f690_Detector1_RX.fcf
And I thought that I had it beat
(36.38 KiB) Downloaded 245 times

Post Reply