cancel
Showing results for 
Search instead for 
Did you mean: 

Ports A & B problem

pbt1668
Associate II
Posted on November 02, 2005 at 21:18

Ports A & B problem

3 REPLIES 3
pbt1668
Associate II
Posted on May 17, 2011 at 12:08

Good morning all,

I am using a uPSD3234 in the 80 pin package

I am having trouble getting the ports A, and B to respond to programming, could you help me?

I’m writing in assembler and here are the snippets of code

I place the CSIOP in PSDsoft to $4000h to $40FFh

Am I correct in thinking that it’s a MOVX command using the data pointer to address these ports?

Many Thanks

Paul Thomas

(CSIOP_BASE = $40h DAT_OUT_A = $04h)

this routine has the value for the port in the Acc.

push DPL

push DPH ;Save the current Data Pointer

mov DPH,#CSIOP_BASE;Default port base address

mov DPL,#DAT_OUT_A;Add offset for Port A output

movx @DPTR,A;Load port A

pop DPH

pop DPL;Restore the current Data Pointer

ret

jdaniel
Associate II
Posted on May 17, 2011 at 12:08

pbt1668,

You're doing essentially the right thing to write data to the port, but you need to set them up correctly beforehand. CSIOP+0x04 is the right address for the data, but you need to set them to MCU I/O mode using CSIOP+0x02 as well as setting the direction as output with CSIOP+0x06. Read up in the datasheet a bit more on these configuration registers and I think you'll be able to get it to work.

pbt1668
Associate II
Posted on May 17, 2011 at 12:08

Many thanks for the timely reply; I do set up the other registers at the beginning of the code.

I figured it was the code, or the setup in PDSSoft.

Nice to be assured the code is right in its format. I’ll try the MCU I/O settings in the software.

Once again Thanks

Paul Thomas

8-) 8-) 8-)