Rockbox Development > New Ports

SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2

<< < (41/386) > >>

fragilematter:
Simple delay test completed: the delay is there no matter what. So you are detecting the usb cable through GPIOA3 or something.

I haven't thought of simply connecting the usb just to the sansa, no PC or power supply, just to see if it has a way of detecting just if the cable is connected (a resistor in the plug, between 2 pins of the connector or something), but I've flashed already. Either way, I don't think that would help too much in development.

But hey, you finally made a breakthrough. Great job!

funman:

--- Quote from: atomikpunk on August 30, 2008, 08:34:27 AM ---Ok so to read the GPIO A pin 3 (which could be the hold button in my findings), you will need to use something like this test.S file:

--- Code: ---  LDR   R1, =GPIOA_REG
...
  LDRB  R2, [R1, #0x20]

--- End code ---

--- End quote ---

Shouldn't we load [R1] ? (GPIOA_DATA, offset 0 relative to AS3525_GPIO1_BASE)

atomikpunk:
Hmmm I doubt that pin A3 is USB but that's not impossible, could you test again with USB plugged in (or not plugged in if it was already in your 1st test) and see if it makes a difference?

funman, look above, I load R1 with the GPIOA base address :)

funman:
Yes but then you load [R1, #0x20], and I understand that it should be [R1]
a.k.a GPIOA_DATA and not GPIOA_DATA+0x20

atomikpunk:
Re-read the register description :)


--- Quote from: datasheet ---So that GPIO bits can be set without affect to other pins in a single write operation, the address bus is used as a mask on read/write operation. The data register covers 256 locations in the address space. The eight address lines used are PADDR[9:2]. During a write, only GPIO1_DATA,... bits corresponding to HIGH address bits are updated. During a read all data bits corresponding to HIGH address bits are read, the other bits are zero.
--- End quote ---

So to read pin A3, one must read at GPIOA_BASE + 0x20 which is address line A[5] high, or pin A3 (5 - 2) as expected. If you would like to read all GPIO pins at once, you would read 0xC80B03FC, which is address pins [9:2] high.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version