Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic12F683 LCD question

Status
Not open for further replies.

lurkepus

Member
Hi
I'm new to using/programming MCU's and i have started with the pic12F683.

I also use assembly to programm the pic since i found the syntax for coding to be easy comapred to C.

The problem i got is to connect he 683 to a hc595 shift register and then to a HD44780 16X2 LCD display. I have been searching for an asembler demo for this setup but so far i have just found a page where the code is in C .

I have managed to connect the 683 to the shiftregister but the problem is that i can just send one bit at the time but to be able to use the LCD i need to be transfereing stuff like 0x20 (LED wakeup sequence) and other simmilar code.

My question is .. Does anyone have an example asm file or a link to a page witch have some code i can learn from .
 
Hi
I'm new to using/programming MCU's and i have started with the pic12F683.

I also use assembly to programm the pic since i found the syntax for coding to be easy comapred to C.

The problem i got is to connect he 683 to a hc595 shift register and then to a HD44780 16X2 LCD display. I have been searching for an asembler demo for this setup but so far i have just found a page where the code is in C .

I have managed to connect the 683 to the shiftregister but the problem is that i can just send one bit at the time but to be able to use the LCD i need to be transfereing stuff like 0x20 (LED wakeup sequence) and other simmilar code.

My question is .. Does anyone have an example asm file or a link to a page witch have some code i can learn from .

If it is an ASM tutorial you're looking for, I have found **broken link removed** to be very helpful.

Good luck!
Der Strom
 
Thanks for the link , I have used that site myself but i haven't found the solution to the problem with the hc595. This page has what i need but the code is in C maybe someone can "translate" it to assembler or maybe post a link to a simmilar page with code written in assembly
 

Unfortunately, just translating C to ASM isn't all that easy. Parts of the program will depend entirely on the chip the original program was designed for, and the chip that is going to be programmed with ASM. It would be difficult for someone who has not used these particular chips to translate.

What you need is a compiler. When you write in C, it usually translates it to ASM when it's compiled, before programming the chip. By putting the C into a compiler, it will translate it to ASM. Keep in mind you may have to make several changes in order to make it work with your chip.

Try using google to find the right compiler.

Good luck!
Der Strom
 
You may be able to run the code in MPLAB and have it translate it to ASM for you. I haven't done this myself, so I'm not sure if you can do that or not. Definitely worth a try, though.
 
the C code on that page i linked to is the same as i use so if i could use MPLAB to convert it it should be ready to use ?
 
Hi,

You might find these sites usefull.

Have to ask why you have to use an extra 74 chip rather than getting a Pic with more pins ?

http://www.rentron.com/Myke1.htm

http://jap.hu/electronic/lcdif.html

i did choose the 683 due to the cost and the features it have .. I got the 683 just to learn more about mcu's .

The reason for the 74 chip was that i came across the page i mentioned and i wanted to see if i could get it to work , witch i'm sure i will if someone points me in the right direction :)
 
I have this code running on a pic12f675.. it was coded in basic... I will send you the assembled file
It uses a 74HC174 as a shift register

The basic file AND the asm file is attached (the asm file has no comments so it may be a little daunting)
 

Attachments

  • SpiLcd.png
    SpiLcd.png
    15.9 KB · Views: 765
  • SpiLcd.asm
    8.2 KB · Views: 204
  • SpiLcd.bas
    1.7 KB · Views: 187
I have this code running on a pic12f675.. it was coded in basic... I will send you the assembled file
It uses a 74HC174 as a shift register

The basic file AND the asm file is attached (the asm file has no comments so it may be a little daunting)
Thanks i will take a look at the file :)


How are you hooking up the 74HC595 and LCD? Same as the schematic on the embedded-lab.com page?

Right now i just got som LED's hooked up to the Hc595 but the pic and the 595 are connected the same way as on that page
 
Hi,

Just tested out that 2 wire link for the 16F84 -it works ok, so have just quicky modified the ports and tried it on the 12F683 and again it seem to work fine in simulation.
 

Attachments

  • lcd_2wire.asm
    5.5 KB · Views: 189
  • lcd2wire.jpg
    lcd2wire.jpg
    37.7 KB · Views: 658
Hi,

Just tested out that 2 wire link for the 16F84 -it works ok, so have just quicky modified the ports and tried it on the 12F683 and again it seem to work fine in simulation.

Thanks :) I will give it a try :) however on the page i linked to they used 2 wires connected to the 595 and one connected to the LCD (data/command) anyway i can try both of em
 
Thanks :) I will give it a try :) however on the page i linked to they used 2 wires connected to the 595 and one connected to the LCD (data/command) anyway i can try both of em

I tried the code (LED instead of the LCD) but i got no output to the LED's. only thing i changed in the code was the ports (to GPIO 1 and 2 ).

Only result i got was a brief blink of all 8 leds when i powerd up the 683.. maybe the code isn't compatible with the 595 chip ?
 
Post removed
 
Last edited:
I tried the code (LED instead of the LCD) but i got no output to the LED's. only thing i changed in the code was the ports (to GPIO 1 and 2 ).

Only result i got was a brief blink of all 8 leds when i powerd up the 683.. maybe the code isn't compatible with the 595 chip ?

It sounds like you didn't put it in a loop. It executes it once, but then stops. Did you write the program in ASM, or did you use the C file? It may also be the watchdog timer--I've had a few issues with that before, too :D
 
it's the lcd_2wire.asm that you will find close to the top of this page ... it was orignaly made for a different pic ,shiftregister and LCD ...
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top