Hi guys,
This is my first post here, though been lurking for a while.... thanks for all the help I've already received.
I'm trying to learn how to program with assembly language, and I've been working through these very useful tutorials.
The problem I have is that the code is written for common cathode displays, and I only have common anode.
I've googled around but have only found examples of code written in 'c' this obviously won't allow me to modify the code to achieve my goals. A search of these
forums turned up this, (http://forum.allaboutcircuits.com/showthread.php?t=35871) but that approach won't work in this case since I'm using a PIC16f684 14 pin device and the segments are spread across two ports, though I did manage to figure that method for myself when using a single display (it worked well,)
in this case because the the ports are overwritten each time the display is updated, the bits controlling the transistors are constantly in a high state and thus all segments are lit at the same time, at least I think that's what's happening.
My code differs from the original in that I have changed the parity of the PORTC lookup table (making the pins active low) and added an exclusive or (XORLW) instruction to reverse the parity of the single bit in PORTA that relates to the 7 segment display. At least that's the approach I think will work, however for whatever reason it's a no go!
Anybody got any thoughts?
Original code can be found here (page 15)
My code is as attached.
My circuit works ok (tested by setting transistors base high, and grounding at each segment pin)
This is my first post here, though been lurking for a while.... thanks for all the help I've already received.
I'm trying to learn how to program with assembly language, and I've been working through these very useful tutorials.
The problem I have is that the code is written for common cathode displays, and I only have common anode.
I've googled around but have only found examples of code written in 'c' this obviously won't allow me to modify the code to achieve my goals. A search of these
forums turned up this, (http://forum.allaboutcircuits.com/showthread.php?t=35871) but that approach won't work in this case since I'm using a PIC16f684 14 pin device and the segments are spread across two ports, though I did manage to figure that method for myself when using a single display (it worked well,)
in this case because the the ports are overwritten each time the display is updated, the bits controlling the transistors are constantly in a high state and thus all segments are lit at the same time, at least I think that's what's happening.
My code differs from the original in that I have changed the parity of the PORTC lookup table (making the pins active low) and added an exclusive or (XORLW) instruction to reverse the parity of the single bit in PORTA that relates to the 7 segment display. At least that's the approach I think will work, however for whatever reason it's a no go!
Anybody got any thoughts?
Original code can be found here (page 15)
My code is as attached.
My circuit works ok (tested by setting transistors base high, and grounding at each segment pin)
Attachments
-
10.6 KB Views: 28