MC9S12XEP100 Port H & Port J used for LED with 74HC04 Hex Inverter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using PH2,PH3,PJ6 & PJ7 of MC9S12XEP100 for glowing LED using 74HC04 Hex Inverter.
Initially when I power the board all four LEDs are ON by default.
LED PJ6 & PJ7 are working as expected but PH2 & PH3 LEDs are continuously glowing even by giving Data on that pin as continuously low.
I have checked the hardware connections & everything is fine there.
So what could be the reason behind this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
can you share the code and the schematic?
Thanks,
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#include "derivative.h" /* derivative-specific definitions */
#include <MC9S12XEP100.h>
#include <stdlib.h>
{
PTH_PTH3=0; /* PH3-LD3 */
PTJ_PTJ6=0; /* PJ6-LD4 */
PTJ_PTJ7=0; /* PJ7-LD7 */
DDRH_DDRH2=1; /* PH2-LD2 */
DDRH_DDRH3=1; /* PH3-LD3 */
DDRJ_DDRJ6=1; /* PJ6-LD4 */
DDRJ_DDRJ7=1; /* PJ7-LD7 */
{
PTH_PTH2=1; /* LD2 ON */
PTH_PTH3=0; /* LD3 OFF */
PTJ_PTJ6=1; /* LD4 ON */
PTJ_PTJ7=0; /* LD7 OFF */
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you disconnect the 74HC04 and check the outputs.
There is only one difference between PTJ6/7 and PTH2/3.
PTJ6/7 have internal pull-up resistor enabled by default whereas PH2/3 don't.
PH2/3 are floating inputs out of reset.
Do you use any alternative function of the pins (SPI, SCI)?
Regards,
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Issue resolved! There was a problem with hardware connection.
Thanks for the help.