Page 1 of 1

RS232 help

Posted: Sat Feb 06, 2016 9:39 pm
by JLeith
Hello All
It has been awhile since using RS232. Last was in Flowcode 5 and the RS232 screen is different in Flowcode 6.

I have a old RS232 help but I can't get it to work in Flowcode 6.

Also I'm looking to send two values and have the receiving end display the results. Now I think I need to use two decisision loops to breakdown say "C5".
First read the "C" and then Read the "5"

I have atattched the flow of my new adventure and also the OLD Flowcode.

John

Re: RS232 help

Posted: Sat Feb 06, 2016 9:45 pm
by acestu
Hi John,

I have moved your post to the FC6 section where you will get help quicker.

Thanks
Stuart

Re: RS232 help

Posted: Sat Feb 06, 2016 10:01 pm
by medelec35
Hi John,
At the start of your flowchart, Just before the main loop you need to add an RS232 initialise component :
Rs232 Not working1.png
(27.12 KiB) Downloaded 10524 times
Martin

Re: RS232 help

Posted: Sat Feb 06, 2016 11:47 pm
by JLeith
Hello Martin

Thank you for the missing spoting the missing "Initalise" for the RS232.

I have it running but can't pin point if I sending digit 5 the LCD says seeing " 0 "

I did a F8 to see what was happening and I see 0 after the post to LCD. it is like it is not reading the RX port C7.

John

Re: RS232 help

Posted: Sat Feb 06, 2016 11:54 pm
by medelec35
Hi John,
JLeith wrote: Thank you for the missing spoting the missing "Initalise" for the RS232.
No problem.
JLeith wrote: it is like it is not reading the RX port C7.
It's not!
Thats because you have if RCV < 255
But no RS232 RX prior to RCV < 255.
Its only after which will be no good.
Therefore the yes branch will never be accessed.
You either need RS232 RX prior to if RCV < 255
or use RS232 interrupt which would be better in my opinion.

Martin

Re: RS232 help

Posted: Sun Feb 07, 2016 12:09 am
by JLeith
Hi Martin

Mystery is still odd.

I took out the "If RCV < 255"

Still getting the '0"

Can you explain the RS232 Interrupt ? I was looking thru the help files and I don't see a video on the subject.

John

Re: RS232 help

Posted: Sun Feb 07, 2016 12:43 am
by JLeith
I went back and study the examples and this time I tried the "Console" Data entry.

The RS232 Data says Received value but it won't dipslay on the LCD.

John

Re: RS232 help

Posted: Sun Feb 07, 2016 12:47 am
by medelec35
Hi John,
A couple of different ways.
1a = without RX interrupt.
1b = with RX interrupt. (RXint call macro is for simulation only. It must be disabled before compiling to chip).

Martin

Re: RS232 help

Posted: Sun Feb 07, 2016 1:00 am
by JLeith
My eyes must be out of sync.

I ran both 1A amd 1B and I don't get a LCD reading.

Do you get a reading

John

Re: RS232 help

Posted: Sun Feb 07, 2016 1:08 am
by medelec35
Yes works fine for me. Have you manually added numbers to the RX queue within the console?

Re: RS232 help

Posted: Sun Feb 07, 2016 8:53 pm
by JLeith
My Errow
I missed the Console.

Yes now it is displaying nicely.

The 1A version workes more like I envisioned. Thank you.

You know the biggest item that I never found in all the information with Flowcode video's.

Using the "Calculatiuons" to receive the ASCII RS232 ( Decimal value) - 48 to get the value that was sent.

Now I just need to do some caluculation routes to detect "HC5" and place it into a variable to us to display the corrrct QUAD 7 Segment.

H = Quad 1 + 2
C = Quad 2
5 = the value to place on Quad 2.

I will play with the 1A and see how it works out. More knowledge for my mind and paper documents to use in the future.

John

Re: RS232 help

Posted: Sun Feb 07, 2016 11:12 pm
by medelec35
Hi John,
JLeith wrote:Now I just need to do some caluculation routes to detect "HC5" and place it into a variable to us to display the corrrct QUAD 7 Segment.

H = Quad 1 + 2
C = Quad 2
5 = the value to place on Quad 2.
I can point you in the right direction with a flowchart.

Are you using the internal or external osc.
If external what value is crystal or resonator?

Martin

Re: RS232 help

Posted: Mon Feb 08, 2016 8:01 pm
by JLeith
Thank you Martin for the help.
This is the knowledge I have developed with RS232 and testing

Internal OSC has worked in the past.

I have tested using the ( 1A version ) it looks like only 2 characters can be received ?

I was planning on using code numbers with the value if that makes sense
I need the follwing from ( Pitch Count Master ) to Team Display Feb 8

Pitch Count Master
H = Home Count
I = Home Tens
J = V_Count
K = V_Tens
L = Reset Home display
M = Reset Visitor

From the Pitch Count Master I beleive the results to transmit can be sent from macro ( timer_int ) the values can be selected as they are displayed for the QUAD 7 segment

Example
H3 TX --------RCV runs Home Count and display in the QUAD 2 digit 3.

I have included the ( Pitcher Count Master ) and the ( Team Display Feb 8th in progress )

In the Team display I was using lower case ( h ) and now I can see capital ( H ) and others is workable.

I hope this works.

Re: RS232 help

Posted: Tue Feb 09, 2016 2:31 am
by JLeith
Hi Martin
I beleive I have a working Team Display.

I was able to get the flow to display on the QUAD 7 segment.

If you have a moment can you look over my flow and see if it can be done a cleaner flow.

I might add a buzzer on the Team display but I think I should use a relay I don't know if I can drive a Buzzer directly.

Martin I see there is a "Speech" Output. Have you worked with it ? Maybe I could use a speaker on the Team Display and when the Pitcher reaches 25 I could have a audio sent by RS232 from the Pitcher control ?

Martin have you done anything with WireLess ? My tx range would be 70 feet (21 Meters). Could I interface via wireless ( PITCHER ------- Team )

I currently will be RS232 with 4 wire connections 21 meters.

John

Re: RS232 help

Posted: Tue Feb 09, 2016 3:36 am
by JLeith
Hi Martin

I thought I would try the 'Speech" Output.

Here is my steps.
1. Added the Output display
2. Access the help files to figure out.
3. Downloaded Speech 2.
4. Add a quick Speech Macro to Team Display ( S )
5. Added the Macro options to Main
6. Simulated ---- No sound ????
7. Went to the Speech 2 flowcode and copied the "Speech"
8. Placed the Speech into my program.
9. **** The Speech worked ****
10. My original Speech would not work.

At a loss. The Help Sample 'Call Macro" is not from Flowcode 5 I tried.

The options in the Sample Macro don't match the options from Flowcode 6.

Re: RS232 help

Posted: Tue Feb 09, 2016 11:08 am
by Benj
Hello,

The speech component has two working modes.

1) The Speak function allows you to output text strings as voice using the RealSpeak library. This is useful for simulation e.g. when using the Flowcode simulation linked to some real world hardware. This has the frilly simulation icon to show it is sim only.

2) The OutputPhoneme function allows you to output a Phoneme or string of Phonemes. e.g. "OY" or "OY,AY,OY". If you look at the properties of the Speech component you will see which Phonemes are present in your program. To say a sentence like "Pitcher at 25 Pitches" you need to break up the words into their phonemes and then output the phonemes, unfortunately there is no automatic way of doing this. "Pitcher" might look something like this as Phonemes. "PP,IH,TT1,CH,ER1,RR1". This speech type should work in both the sim and on the embedded device.

If you need good sounding speech strings then a better way might be to record the audio yourself as a wav file, store the file onto an SD card and then on the embedded device stream the audio from the SD card. This is how things like musical birthday cards and children's story books work, though maybe without the SD card :D .

There are examples of both speech types here: http://www.matrixtsl.com/wiki/index.php ... de5f9b41a8

Hope this helps.

Re: RS232 help

Posted: Tue Feb 09, 2016 10:22 pm
by medelec35
I have looked into speech a bit and it fails to compile with 16F1937 as it does not have a Program memory table like the PIC 18F series.

No I have never used the speech component yet.

Martin

Re: RS232 help

Posted: Tue Feb 09, 2016 10:29 pm
by JLeith
Hi Martin
Which 18F would work.
Very odd when I paste the Speech from the help file I get the speech 100% when I run the flowcode.

So you are saying that there will be no audio be presented to PORT C2 ?

John

Re: RS232 help

Posted: Tue Feb 09, 2016 10:36 pm
by medelec35
JLeith wrote:Very odd when I paste the Speech from the help file I get the speech 100% when I run the flowcode.
So you have compiled flowchart and it compiles 100% successfully?

Re: RS232 help

Posted: Wed Feb 10, 2016 3:19 am
by JLeith
No I have not had a chance to compile.

Hopefully tomorrow ( Wed )

I will let you know the status. I ran out of Bread Boards.

John