Hi John
No problem,
I can use my 16F1937 on bread board and get it all working for you.
One issue is that i'm use to active high, but your'e using active low so I have corrected that.
I have changed port B IOC from active high to active low as explained in the above post.
I have also changed the max wait time from 500ms to 2 seconds just to allow a bit more time when manually pressing switch.
It can be changed back when happy with operation.
JLeith wrote: added the loop 5 as you suggested and I only get D0 on when I say all PORT D = 1. Flowcode acts like Breadboard.
When using the Entire port rather then single port:
When output = 1 then only D0 will light.
When output = 2 then only D1 will light.
When output = 3 then only D0 & D1 will light.
When output = 4 then only D2 will light.
When output = 5 then only D0,D1 & D2 will light.
Just add up all values for all the LEDs you want to light:
Code: Select all
D7 D6 D5 D4 D3 D2 D1 D0
128 64 32 16 8 4 2 1
So if you want to light all LEDS:
1 + 2 + 4 +8 + 16 + 32 + 64 +128 = 255
so all PORT D = 255
Finally moved the c code block to the very top of main sice its only when code block is accessed then hardware is set to run at 32MHz.
From memory,before C code is accessed osc will be euinning at 500KHz and all of port b will be floating so LED will take a long time to light.
Ran out of time now, but if you would like to see if assached chart works better, I will check it out myself on hardware later.
Martin