Jump to content

Recommended Posts

Hi,

 

I've searched the forum and related links to find if anyone has developed code using BoostC for getting ps/2 keyboard inputs into the PIC.

 

Not finding any, I have started developed code which translates keyboard keyed input to ascii output. Translation table has been worked out. I'm

working on code now to taking recieved bytes and getting an ascii byte out.

 

Looking through a book by Nigel Gardner, "PICmicro MCUC" written for the CCS C compiler, the book stated that CCS C has a header file, "conio.h", which has a kbhit() and gets(str) and maybe other functions for keyboard input. Before continuing my code development, it seemed prudent to see if I miss some other code source here on the forum or if other header files or codes files are available.

 

If not, I'm willing to share what I have done so far.

 

All the best,

 

Eric RO

Jensen Beach FL USA

Link to post
Share on other sites

Hi Eric,

 

I done something way back in late 2000 interfacing a ps2 keybaord (101 key I think) to a serial port.

I used a 16C558 chip which has no UART so had to bit-bang into 9600 baud.

The serial comms worked both ways so I could send reset and led commands to the keyboard for num and shift lock etc. via serial port.

I was all done using MPLAB assembler. Ahhh, those were the days. Sigh!

The project never came to anything so did not get a chance to put it good use.

You may have whetted my whistle to look back on it and rewrite in C. Not that I have a use for it but just for the interest using a more up to date PIC with built in UART.

 

Cheers

 

Reynard

Link to post
Share on other sites

Hi Renard,

 

Thanks for your response.

 

Microchip has written a PS/2 to USB keyboard translator in assembly (MPASM code), which has given me some insite on developing C keyboard code. It's in their TB056 (DS91056C) document and related down-loadable MPASM code file. It was written for the PIC16C765. TB056 document has a PS/2 Keycode table which I used in my work.

 

For SourceBoostc C coding, do you know whose assemby coding they are following and what directives are available. I would like to have the ability to include asm code in with my C code. I did not find any info on this in SourceBoostc documents and on this forum. Maybe I missed something.

 

Agsin thanks for responding.

 

All the best,

 

Eric RO

Link to post
Share on other sites

Hi Eric,

 

Thanks for the ps2 info, I will have a look at this Microchip code.

 

I compiled the interrupt.asm in the examples directory and the listing file says MPASM 5.14

 

How you set up argument passing and return values is another thing.

 

Perhaps Dave or Pavel could clear up how to interface to a pure assembly file (.asm).

 

Cheers

 

Reynard

Link to post
Share on other sites

Reynard,

Perhaps Dave or Pavel could clear up how to interface to a pure assembly file (.asm).
Can't be done. The best option is to wrap the assembley routines in C functions that will compiler under the BoostC compiler.

 

Regards

Dave

Link to post
Share on other sites

Dave,

 

Thanks for getting back to us.

 

Questions:

 

1. Is Sourceboost C assembly code based on MPASM or subset of MPASM?

 

2. If yes, what version, etc.?

 

3. If not, whose assembler and where to get user manual?

 

4. The orignal question in his thread was, are there any PS/2 keyboard header files or source codes written for SourceBoost C compiler?

 

 

Thanks for your help.

 

All the best,

 

Eric RO

Link to post
Share on other sites
1. Is Sourceboost C assembly code based on MPASM or subset of MPASM?
Use the same opcodes and format as MPASM

 

2. If yes, what version, etc.?

3. If not, whose assembler and where to get user manual?

Not applicable, this detail only really applies to assembler directives which are not supported.

 

Regards

Dave

Link to post
Share on other sites

RSABear,

 

I have not seen this code before.

 

There are three #include files needed to use program:

 

LCDTest.c

keyblch.h

scancod.h

 

I don't have a source for these additional files. If you do let me know.

 

The code I'm working on also uses the LCD files supplied with the sourceboost C compiler.

 

Also, recieved your "My Assistant" contact. I wasn't aware of this method of contact.

 

Thanks for your help.

 

 

All the best,

 

Eric RO

Link to post
Share on other sites

Cool patatoes! Let me know if you can get it working - I would like to connect a Numeric Keypad to my 16F877/887 projects. I have not yet had time to do the PS/2 code and somehow lost the keypad when I moved home in December. I am now working on getting the PIC18F4550 to speak USB CDC first.

Link to post
Share on other sites

cac001,

 

The code on www.electronic-engineering.... site is written in asm. Per Dave's comment on this thread, it looks like it would be a problem to intergrate this asm code into boost C.

 

 

RSABear,

 

The code I'm working on is a little more complicated and I need to simplify it. I will get it to you when I get it working.

 

Thanks again.

 

All the best,

 

 

Eric RO

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...