Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Reading PDSR and getting strange results
PostPosted: Sun Jun 14, 2009 2:22 pm 
Offline

Joined: Sat Feb 02, 2008 11:35 pm
Posts: 15
Location: USA
Hi,

I'm having trouble reading an 8bit port setup as input with no internal pull ups enabled. I keep getting strange values, sometimes it'll settle on the correct value but mostly appears random.

I am reading 8 lines off a 74HCT245 driven by 5volts and my portb IO is 5volt tolerant. On my scope I can see the I/O all the way to the micro pins are fine but the read of the input fails most of the time. Perhaps if I wait a second or to, it'll settle however its not following the true signal.

I have noticed an errata in the datasheet showing possible problems with output impedance<500 but the 245 is directly wired to the micro and it can easily drive high enough currents. I can certainly see the change with my scope.

Cheers,

DC


Top
 Profile  
 
 Post subject: Re: Reading PDSR and getting strange results
PostPosted: Thu Jun 18, 2009 11:55 pm 
Offline

Joined: Wed Jun 07, 2006 10:52 pm
Posts: 60
On the SAM7 parts you have to enable the PMC for the GPIO you are reading. If the pins are on GPIOA, you have to enable that peripheral in the PMC, if they are on GPIOB you have to enable that peripheral, otherwise reading them will give erroneous data.

Code:
AT91C_BASE_PMC->PMC_PCER = 0x04;   // GPIOA is Peripheral ID 2   
AT91C_BASE_PMC->PMC_PCER = 0x08;   // GPIOB is Peripheral ID 3


The above code was used on a SAM7A3. Double check your part to make sure its the same.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: