Hello! I know the basics of programming in Zilog, Atmega(arduino), and PIC microcontrollers.
My questions here will be all about Zilog (z8F6421).
1. Can I use each pins of a certain port in Zilog, just like in arduino?
like: pin1 = HIGH; //in arduino.
I only know: PAOUT = 0x01; //in Zilog.
2. I have 8 Leds, and I have to shift each bit to the right.
The codes above is only for shifting one bit at a time.
But here comes my problem:
I have to shift one bit at a time, but when it comes to the right most bit, the display will be still. Ughh, I can't describe it well. But I have a picture below.
loop[0] = 1000 0000 up to 0000 0001
loop[1] = 1000 0001 up to 0000 0011
loop[2] = 1000 0011 up to 0000 0111
until 1's occupy the whole octet. Please help
My questions here will be all about Zilog (z8F6421).
1. Can I use each pins of a certain port in Zilog, just like in arduino?
like: pin1 = HIGH; //in arduino.
I only know: PAOUT = 0x01; //in Zilog.
2. I have 8 Leds, and I have to shift each bit to the right.
Rich (BB code):
int dataShift = 0x80 //Start from the value leftmost bit
for_loop... from 1 to 8
if(dataShift==0x00) dataShit = 0x80; //reset if data becomes 0
PAOUT = dataShift;
dataShift=dataShift>>1; //shift 1 bit at a time
But here comes my problem:
I have to shift one bit at a time, but when it comes to the right most bit, the display will be still. Ughh, I can't describe it well. But I have a picture below.
loop[0] = 1000 0000 up to 0000 0001
loop[1] = 1000 0001 up to 0000 0011
loop[2] = 1000 0011 up to 0000 0111
until 1's occupy the whole octet. Please help