Jump to content

Pic18F series output pins

- - - - -

  • Please log in to reply
19 replies to this topic

#1
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
Hey everyone.

I have been having trouble with the 18f4525 pic. I set up each port as output, and turned them alll high, but when i test it, no pins are held high.. I am wondering if it is a software issue, so I am posting it here to make sure my code is correct.

LIST P=18F4525, F=INHX32

#include <P18F4525.INC>


Movlb 15

clrf PORTA

clrf PORTB

clrf PORTC

clrf PORTD

clrf PORTE


clrf TRISA

clrf TRISB

clrf TRISC

clrf TRISD

clrf TRISE



Unlock:

movlw b'11111111' 

movwf PORTA

movwf PORTB

movwf PORTC

movwf PORTD

movwf PORTE

goto Unlock


end

It isnt much, but keep in mind i need to be able to hold an output high before i can make my actual program.

Thanks

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Are you sure they aren't active low pins?

#3
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
What's the difference?

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Because it means exactly the opposite of what you'd expect. A logical TRUE is low voltage, FALSE is high voltage. On the pin diagram, do any connections have a line over the name? That's the standard notation for "active low."

#5
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
http://www.hvwtech.c...C18F4525_G1.gif

Thats the pic

I wouldn't expect every pin to be held low voltage, unless its by default low. I am testing each pin as an output, and so far, nothing has worked

#6
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Might've fried it.

#7
darknoobie

darknoobie

    Newbie

  • Members
  • PipPip
  • 19 posts
Hello, I am new to the forum. I was looking at the asm code you have. The chip you are using i believe has A/D converter so you would have to turn off register(adcon0)(bit0) of by setting it to 0. But not all ports are used in A/D Converter.. so you might have a fried chip. p.s. Static kills :)

#8
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
When i reprogram it, it doesn't show any errors with the rom or fuses or anything. could it still be fried?

#9
darknoobie

darknoobie

    Newbie

  • Members
  • PipPip
  • 19 posts
Have you tried running the code in a simulator. MPLAB-SIM(windows) or GPSIM(linux). If it functions correctly in the sim then you have a damaged pic micro. Even if it programs it can still be damaged since the flash memory is separate module from the port module inside the chip. I have had issues with the pic 12f675 where 1 port was not functioning but everything else did. I ran the simulation and concluded that my chip was bad. Gl

#10
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
I have actually. How does one damage a chip? I mean i handle it with my hands, but I have done that in the past with a 16f628a, and it didnt seem to affect it.

#11
darknoobie

darknoobie

    Newbie

  • Members
  • PipPip
  • 19 posts
The internal modules(transistors) are very very small :D Static electricity can reach peaks of several thousand volts which is more than enough to destroy those tiny components in micro controllers.

#12
darknoobie

darknoobie

    Newbie

  • Members
  • PipPip
  • 19 posts
Every chip is designed different.... also you have to take in consideration of the environment you were in when working with the different chips, maybe what you we wearing or walking on, caused static electricity.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users