Hello,
I’m not good at programming yet but working on it, that’s why I bought FlowCode v3 hoping it could do it all. But as I found out after using it for a while and checking the posts it turns out that it has limited RS232 capabilities. I learned it was mainly setup to program a master chip to communicate with Eblocks. I am trying to set up a simple program where I can remotely dim four lamps using PWM on two slave chips controlled from one master via RS232. I’m using three 16F877A IP chips each with their own 20MHZ crystals, setup – HS. WD timer off. I have checked the data sheets regarding addressable RS232 TX and RX bits but I am not clear on how to put it in my flow chart. I’ve tried various ways using the component macros and calculation boxes keeping in mind some of the examples found on the web site and in the forums but never saw anything that was exactly the same set up I’m trying to do, just bitts and pieces of other good things. I tried some string manipulation stuff as well but no luck. I’m doing the tests using three breadboards with direct connections and no Max CPE chip at this point. I think I’m having framing or data shifting issues. Some times it seems to work for a vary short time then the data gets crossed up or become intermittent. I’m using the same variable names in all the chips? I have uploaded the fcd. files In hopes that someone can shed some light on my problem. Any help would be appreciated, Thanks guys
Cris
RS232 Master Slave Setup
RS232 Master Slave Setup
- Attachments
-
- LAMP DIM SLAVE 2.fcf
- (5.5 KiB) Downloaded 337 times
-
- LAMP DIM SLAVE 1.fcf
- (5.5 KiB) Downloaded 339 times
-
- LAMP DIM MASTER.fcf
- (7.5 KiB) Downloaded 351 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 Master Slave Setup
Hello
I have had problems with this in the past. Are you commoning the grounds between each of your devices. This was the step that I missed when getting UART devices talking in a Master / Slave setup.
I have had problems with this in the past. Are you commoning the grounds between each of your devices. This was the step that I missed when getting UART devices talking in a Master / Slave setup.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Dan81
- Valued Contributor
- Posts: 268
- Joined: Sun Jan 15, 2006 4:07 pm
- Location: Albi France
- Been thanked: 60 times
- Contact:
Re: RS232 Master Slave Setup
Hello
I think the problem is that your 3 boards are not synchronised and your "slave" delays are too long.
I've modifed the value of LAMP_x in order to differentiate the first from the other three.
The "Slave" flowchart can be almost the same for the two slave boards.
Don't send 255, it's a special value to indicate that there is no reception (see RS232 help within Flowcode).
The Flowcharts are not fully tested but I think they're quite good
Daniel
I think the problem is that your 3 boards are not synchronised and your "slave" delays are too long.
I've modifed the value of LAMP_x in order to differentiate the first from the other three.
The "Slave" flowchart can be almost the same for the two slave boards.
Don't send 255, it's a special value to indicate that there is no reception (see RS232 help within Flowcode).
The Flowcharts are not fully tested but I think they're quite good
Daniel
Re: RS232 Master Slave Setup
Thanks for your input guys!, Daniel I appreciate the time you spent making changes to the fcd files. I’m using one of my 3 breadboards for another project at the moment but I did test the master and one slave as uploaded, and It seems to work like a charm, great!. I’m going to look at the additions and changes more closely to see how and why they work and try to adapt it for the slave 2 chip. But one thing I can see and I never thought of, was letting all the data filter through the programs on each chip and filtering out the variables in the programs themselves and not worrying about trying to address and send data to each individual chip. I’m going to try and get some time this weekend to give it a go. Also Ben makes a good point on bonding the grounds together, I can see that would be important, and I did have a common ground as the whole setup was fed from one supply daisy chained together. Again thanks for all your help guys and hopefully I’ll be ok from here.
Cris
Cris