8255 C code

Status
Not open for further replies.

darlling5147

New Member
may i know who can help me to get the C source code for 8255?
B port as input
c port(PC0-PC3) as output
c port(PC4-PC7) as input
i have no idea how to write the code...pls help me...!!!
 
Isn't an 8255 just an interface IC?, and not a processor? - or am I confusing it with something else?

Because if it is, you need to know how it's connected before you can do anything else - then you need to know the details for setting the registers in the 8255.
 
darlling5147 said:
yup....8255 is interface I/O IC.....can help me?i really headaching now!!!

Never used one (it's also over 30 years old!), nor do I use C, but as I said before it depends what you've got it connected to, and how it's connected, the 8255 has very little to do with it. From vague memory I seem to recall it's a memory mapped chip?, in which case the registers will appear in the memory map of the processor where you've designed it to be.
 
my 8255 is connecting to ADC0804.

PB0 to PB7 connecting to isbDB0 to msbDB7
PC0 connect to WR
PC1 connect to RD
PC4 connect to INTR

this is my connection btw 8255 and ADC0804

can help me to write the source code to programme into 8255?

kindly apprieciate !!!!
 
You still haven't mentioned anything that's programmable yet!, and I still don't write C anyway!.
 
Nigel goodwin !!! i'm now trying to understand how to program the 8255. if i got any Q onli come here ask u,ok?very thx for ur help
 
ok, I'll take a shot at it, nigel...

darlling5147, your 8255 must be accessed by some sort of microcontroller or microcomputer in order to program it to the modes you want. until you say what that microcontroller/computer is, no one can possibly help you. I understand that you have the 8255 connected to an ADC - what else is it connected to??? what are you doing with the data from the ADC?
 
In great graphic detail what we are asking you to tell us is not what ports A, B, and C of the 8255 are connected to because that is not relevant to the problem at hand. What we want to know in order of importance is what is connected to

CS*(pin 6)
A0(pin 9)
A1(pin 8)
WR*(pin 36)
RD*(pin 5)
RESET(pin 35)
D0-D7(pins 27 thru 34)

The following link may be helpful to you
https://jap.hu/electronic/c64pio.html

BTW, for the umpteenth time on this forum, a schematic of your circuit would be most helpful in getting what you want.
BTW-2; I can write any piece of C code that can be specified, but I need to know which compiler and which processor. You've have not mentioned either a processor or a compiler.
 
Last edited:
Still no processor. Until you get it through your thick skull that the 8255 is a peripheral chip and NOT a processor we might as well be talking to a post. An 8255 cannot be programmed in C or any other language. What is it about these statements that you fail to comprehend?

Read some data sheets.
An 8080 is a processor
An 8085 is a processor
An 8088 is a processor
.
.
.
and the list goes on. Find a processor and connect it to the 8255. It is also possible that if you found a suitable processor you would discover that the the processor could be connected to the ADC0804 directly and you would not need the 8255.

Sigh....
 
Do you guys think you are helping?

Attached is my 8255 interface circuit and GWBASIC program to “PROGRAM” the 8255 and read 2 bytes from 2 registers, 1 nibble at a time from the LPT1 status byte. After you understand it, you can translate it to C. GWBASIC is free. If you have XP, you will have to run it from an old DOS 5 or 6.2 boot disc.
 

Attachments

  • My Interface project small.gif
    308.7 KB · Views: 352
  • Readppi.txt
    4.8 KB · Views: 265
ClydeCrashKop said:
Do you guys think you are helping?

Do you think you are?, you've made a blind guess at a particular processor type, and type of connection - neither of which have ever been suggested by the OP.

Assuming that is what he's trying to do?, why the 8255 anyway?.
 
To start with “yup....8255 is interface I/O IC.....can help me?i really headaching now!!!”, I assume he want to interface to a PC, 80XXX. And “ok......my ADC is for temperature sensor my circuit include 8255+ADC0804+UA741+LM35” he wants to display the temperature on the computer or use it in a program. Before PICs came along, 8255 interface circuit was the best thing that ever happened to electronics hobbyists.
I really like this forum and there are some very knowledgeable and helpful people here. You remind me of my last boss. He had a negative remark to say about any subject whether he knew anything about it or not. At the risk of being kicked off, you are more like a troll than a moderator. Everyone has to get past Nigel’s bridge and take his negative remarks no matter what the subject. Sorry Nigel, but I had to say that.
 

What 'negative remarks' - I asked what processor he's using, as did everyone else - whereas you just made the wild assumption it's to connect to a PC (in which case why use the 8255?).

I also disagree with your comment about the 8255, a poorly thought out PIO with limited and confusing modes, the 6522 was far better
 
ClydeCrashKop said:
To .... you are more like a troll than a moderator. Everyone has to get past Nigel’s bridge and take his negative remarks no matter what the subject. Sorry Nigel, but I had to say that.

I dont think so. Nigel and others were trying to understand a badly defined problem which was probably going the wrong way anyway. (Like so many posts/questions on here).

Nigel is usually correct (except on the topic of earthing oscilloscopes! ), and I think he is correct in this instance.

JimB
 
A lot of people here know how, but most of also know better faster cheaper simpler ways to expand I/O.

If you read back in this thread there is a reference to a good tutorial. And of course if you have access to very old archives - there's the data sheet.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…