2003-07-17 04:07 AM
2003-07-16 04:38 AM
I have a software problem with wait instruction; I use wait to freeze the ST6 during AD conversion, but i fall low a pin before start of conversion and raise it after wait instruction. THe pin is configured in output open drain
The piece of code is res 0, copy_portb ld a,copy_portb ld port_b,a ;Pb0 high ld adcr,.............. ;start of converision wait nop nop set 0, copy_portb ld a,copy_portb ld port_b,a ;pb0 low I suppose that Pb0 remains low until ad conversion and ad interrupt treatment terminate, but from oscilloscope measurements result to me that after Pb0 goes low then immediately goes high and remains high then goes low again after ~ 100 us and immediately goes high again. So my question is if is possible that the wait instruction set the pin in high impedance mode, or something like this, that generate a high level. thanks in advance Mario d'ettorre2003-07-16 11:27 PM
Hi,
are you changing the OR or DR to select the ADC channel? If you are using thr DR, you will be leaving OR high, which will create spurious interrupts. Leave the DR bit high and take the OR bit high to select the channel, take the bit low to deselect the channel. Hope this helps, Simon [ This message was edited by: sjh on 12-11-2003 16:19 ]2003-07-17 04:07 AM
I select a static I/O configuration at start of program, so i don't change the OR register in the rest of program