Jump to content
Jagware
willy

How GPIO's are working

Recommended Posts

willy    0

Hi.

I'am trying to understand HOW EXACTLY GPIO's in jaguar are working.

Let's take first example, eeprom access code developed by Atari. Take look at the last section:

 

JOY1		equ	$f14000		;this we'll use as our I/O base address
GPIO_0		equ	$f14800		;General purpose I/O #0
GPIO_1		equ	$f15000		;General purpose I/O #1
;
;   Equates derived from the above
;    to allow indirect with 16-bit displacement addressing
;
GPIO_0of	equ	GPIO_0-JOY1	;offset to GPIO_0 (when addr reg Ax -> JOY1) 
GPIO_1of	equ	GPIO_1-JOY1	;offset to GPIO_1 (when addr reg Ax -> JOY1) 
;
; entry:
;  a0 -> JOY1
;  d2.w = 9-bit command to write
;
out9bits:
	rol.w	#8,d2		;align 1st serial data bit (bit8) to bit0
	moveq	#8,d3		;send 9
out9lp:
	move.w	d2,GPIO_0of(a0)		;write next bit
	nop
	nop
	nop			;delay next write
	nop
	nop
	nop
	rol.w	#1,d2		;adjust bit0 for next datum
	dbra	d3,out9lp	;go for all 9 or all 16
	rts

 

this line:

	move.w	d2,GPIO_0of(a0)		;write next bit

asserts clock signal line (GPIO0) and set D0 data line.

I'm wondering how the Clock signal is deasserted ?

 

Another example form same code, asserting /CS line (GPIO1):

	tst.w	GPIO_1of(a0)	;strobe ChipSelect

How it is deasserted ?

 

Seems like I missed something??

Hope somebody can help with understanding that.

 

Best Regards

Willy.

 

Share this post


Link to post
Share on other sites
Zerosquare    10

They're chip-select lines, they only stay asserted during the duration of the memory access.

In other words, you can't set them high or low, you only get a very short pulse when you access memory in the memory area associated with the GPIO pin.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×