gandalf_be
Junior Member level 1
Hello All,
I'm busy with writing a program that has to do the following:
I have a 16 bit value that is stored in two internal memory locations
At a certain moment i had to put the bitdata bit by bit to an IO/pin serial clocked on the rythme of an external clock connected at an IO pin (16 clock pulses). The 17th clock puls resets the value that was stored in the memory locations.
first method that i used was storing the data in normal internal data location and throug a rrc instruction the bit data comes on the io pin. this works fine but in a later stadium a had to do this for two 16 bit values at the same time.clocked at two different clocks .This means that i have to push and pop a lot because i'm only have one carry bit and accu.
I thought to be clever and stored my values in the bit addresable locations .by means of a pointer i could easily bring out the bit data.
after each clock pulse i incremented the pointer . but for some reason he refused to bring out the next databit. I can see with the debugger the values after incrementation of the pointer (viewing through A)
for some reason the programm refuse to used the incremented pointer value . I tried to use the set directive instead of equ but i doesn't seems to work eiher .
Please have a look in the small program in the attachment.
Ofcourse I could write the routine for each seperate bit 16 times but i want to avoid this.
Anybody has an idea how to solve this in a proper way without a lot of push and pops etc...
For your information i'm using a C8051F120 develeopment board from cygnal. with the Cycgnal IDE (keil )
Kind regards,
Gandalf
I'm busy with writing a program that has to do the following:
I have a 16 bit value that is stored in two internal memory locations
At a certain moment i had to put the bitdata bit by bit to an IO/pin serial clocked on the rythme of an external clock connected at an IO pin (16 clock pulses). The 17th clock puls resets the value that was stored in the memory locations.
first method that i used was storing the data in normal internal data location and throug a rrc instruction the bit data comes on the io pin. this works fine but in a later stadium a had to do this for two 16 bit values at the same time.clocked at two different clocks .This means that i have to push and pop a lot because i'm only have one carry bit and accu.
I thought to be clever and stored my values in the bit addresable locations .by means of a pointer i could easily bring out the bit data.
after each clock pulse i incremented the pointer . but for some reason he refused to bring out the next databit. I can see with the debugger the values after incrementation of the pointer (viewing through A)
for some reason the programm refuse to used the incremented pointer value . I tried to use the set directive instead of equ but i doesn't seems to work eiher .
Please have a look in the small program in the attachment.
Ofcourse I could write the routine for each seperate bit 16 times but i want to avoid this.
Anybody has an idea how to solve this in a proper way without a lot of push and pops etc...
For your information i'm using a C8051F120 develeopment board from cygnal. with the Cycgnal IDE (keil )
Kind regards,
Gandalf