Hi
I am simulating a 16F628a and i have leds connected to B0, B3, B4, B5. I wanted to flash these ports on and off about 4 times and then leave B5 on.
I tried this using port masking checking the ports listed above and also by trying by just selecting all ports without masking. the only port that flashes is B0. If on the other hand i just select one port at a time IE sat bit 3 on port B the led associated with that port flashes as expected.
My though is that the ports need telling that they are outlets but I can't see how to set that in the simulation mode.
Any ideas
Thanks and Regards
16F628A Port B connected LEDS
- 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: 16F628A Port B connected LEDS
Hello
The ports are configured as outputs when you use an output icon. If you are using masking then only the masked outputs will work which explains the problem you are having. What about toggling the bits in a byte variable and then simply writing the variable to the port.
The ports are configured as outputs when you use an output icon. If you are using masking then only the masked outputs will work which explains the problem you are having. What about toggling the bits in a byte variable and then simply writing the variable to the port.
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
Re: 16F628A Port B connected LEDS
OK
I had the set up as recommended, ie masking the correct ports. What I found worked was use a variable. i called one variable for setting masked outputs high and another variable for setting masked outputs low.
I made variable B_output_high = 255 and B_output+low = 0 and used the mask to set the correct ports
Cheers
Ian
I had the set up as recommended, ie masking the correct ports. What I found worked was use a variable. i called one variable for setting masked outputs high and another variable for setting masked outputs low.
I made variable B_output_high = 255 and B_output+low = 0 and used the mask to set the correct ports
Cheers
Ian