chip select for control of a perefiriya

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

chip select for control of a perefiriya

612 Views
sidnevmaxim
Contributor I

Mcf5235 processor. As programmatically by means of chip select to exercise control of a perefiriya connected to the data bus. For example how to write information in the register being on the data bus

Labels (1)
0 Kudos
5 Replies

484 Views
TomE
Specialist II

"Perefiriya"? I'm guessing you mean "Peripheral".

The code is simply:

*address = data;

"address" has to be typed properly and set to an address decoded by one of the Chip Selects in the Chip Select Module.

In the mode primitive code this can be as simple as the following, assuming you want to write "0x10" to the 4th byte-addresses register and the chip select decodes from 0x10000000:

*((volatile unsigned byte *)0x10000004) = 0x10;

Tom

0 Kudos

484 Views
sidnevmaxim
Contributor I

Hello!

You not absolutely correctly understood me.  I give a fragment of the diagram which needs to be implemented in attachment.

Question how programmatically to light D1 LEDs... D8. How to create CS2 signal

0 Kudos

484 Views
TomE
Specialist II

> You not absolutely correctly understood me.

You're not explaining yourself. I have no idea how much you know, what language, what compiler, assembly, C, C++, CW version you're using.

> I give a fragment of the diagram which needs to be implemented in attachment.

There was no attachment on your original post and none on the followup. Try fixing that.

> Question how programmatically to light D1 LEDs... D8. How to create CS2 signal

What is a "D1 LEDS"? Is that 209 in Hex?

You create a CS2 signal by writing to an address that the Chip Select Controller has been programmed to associate with that address.

You should read that section in the manual and write some code first. Look for example startup code that programs the Chip Selects to get to other peripherals or to RAM and start from that.

You should even be able to set up the registers and read and write the registers from the debugger.

You startup code has to set up the chip selects for the ROM you're running from, so it's just a copy/pate/modify on that.

Tom

0 Kudos

484 Views
sidnevmaxim
Contributor I

I give a diagram fragment

On the data bus through a chip of D3 LEDs are connected

Explain as to me to exercise control of LEDs..

scheme.jpg

0 Kudos

484 Views
TomE
Specialist II

> a chip of D3 LEDs

What do you mean by "D3 LED"?  I doubt if it can be these guys as they don't make anything with less than hundreds or thousands of LEDs on them.

D3 - Dynamic Digital Displays

> Explain as to me to exercise control of LEDs..

I did that already. What part of "*address = data;" don't you understand?

Maybe you've used old chips with I/O instructions before and don't understand the concept of  "memory mapped I/O". You should read the following, and if that doesn't explain how to do this, say what else you need to know:

http://en.wikipedia.org/wiki/Memory_mapped_IO

I have four comments on your circuit, which won't work at all as drawn.

1 - You have all the LEDs in backwards, or you need to connect the LED common to ground.

2 - You should connect the MR of the 74LVC273 to Reset and ground the LED common so they all go OFF on reset. If you want them all ON at reset (can't see why) then reverse them and connect common to 3V3. Common ground also has writing a "1" turn them on which is slightly simpler than writing "0" for on.

3 - The 74HC32D is redundant. The Chip Select signal trailing edge defines the timing and not the R/W signal. So if you only write to the port you don't need the R/W qualification.

4 - The MCF5235 has about 80 GPIO pins good for 5mA. The ones not used for other functions are available to drive LEDs and so on. That's usually enough to drive LEDs unless you need more then 5mA or have an EMC requirement requiring isolation from electrically noisy CPU pins.

Tom

0 Kudos