Problem Ports on H8S/2378 (Renesas)

Hello,

I try to use (for example port 5) as an digital input. After a reset the port should be an input. Is there any register to get the ports working, like the 'Module Stop Control Registers' for the peripheral modules? Init: P5.DDR = 0;

Reading: helper = P5.DR.BYTE;

Thank you!

Reply to
Oliver Hager
Loading thread data ...

The hardware manual that describes the power down modeule registers describes I/O ports retain values while in module stop.

It is always advisable to be sure that the modules you want to use are powered up regardless of what the manual says the initial values may be a silicon change may have a different state.

This looks like you are using HEW include files and an unknown compiler. Beware those include files use int where they should be using short, as depending on your compiler it is possible for several H8/H8S compilers to force all int to be 32 bit which messes up all the register includes in those files.

The hardware manual has a section on I/O Ports and tells you what the registers do and also depends on the chip if you have enables IRQ0 to IRQ3 or SIO2 as to whether the port pins function as interupts or as special functions.

As some of these pins can be interupts, I would ensure you have followed the section for port 5 to ensure the pins you want to read are truely configured for I/O and not interupts or serial port.

Depending on which compiler you are using you may find my sig block useful.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
 Click to see the full signature
Reply to
Paul Carpenter

Thanks Paul Carpenter!

Reading the hardware manual carefully is a good way. They changed the function of the Port Data Register from H8 (Tiny) to H8S core. The right register for input is now "P1.PORT.BYTE". I'm using HEW.

best regards

Oliver

"Paul Carpenter" schrieb im Newsbeitrag news: snipped-for-privacy@pcserviceselectronics.co.uk...

Reply to
Oliver Hager

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.