(you are viewing a thread; or go back to
list of threads)
which lcd (by bob dole)
i need to buy a serial lcd iam just wondering about which ones are compatable with ldmicro
would this one be ok
16 x 2 characters, CFA 632/634 Controller
http://www.crystalfontz.com/product/CFA632YFHKS
and a bigger screen
20 x 4 characters, CFA 632/634 Controller
http://www.crystalfontz.com/product/CFA634YFHKS
lcd choice (by Ziggy)
As you will be using the RS232 communication path to transfer data to the LCD eiter module will be OK since both employ RS232 port to communicate with the external controller.
Just note whether the protocol is serial TTL level or serial true RS232 that is +/- signaling voltages.
(no subject) (by bob dole)
i understand ziggy its just i only plan to you rx and tx from a pic microcontroller programed in ldmicro and am wondering about the coding involed. was ldmicro programmed with the code for the CFA 632/634 Controller.
ill buy them 2 lcds and give it a try anyway.
also i already bought a serial lcd BV4108 and had no look getting that to work with ldmicro
(no subject) (by Ziggy)
I am not familiar with the LCD controller.
I am sure that as it is a serial interface module You may have to send some initialisation strings via the serial port much like the content of the LCD display.
(no subject) (by MGP)
I use this software for my experiments.
A 16F628a costs +-2 euro's and a LCD +-5 euro's.
http://www.freewebs.com/x7jay7x/
This is an example to use it.
(no subject) (by bob dole)
that custom built serial to parallel driver looks interesting. ill give it a try. could you post link to the HD44780 compatible LCD or will any parallel one do.
(no subject) (by MGP)
Any parallel HD44780 or compatible lcd (2x16 to 4x20) will do.
BTW
Don't connect an output directly to the base of the transistor,
use a 1K resistor in the base of the transistor T1.
The input (rx) from the buttons are char 'A' 'B' 'C' 'D'
No need to use an MAX232 if the distance is <50cm
(no subject) (by bob dole)
noted
i was wondering what the buttons were for so its for testing it i presume.
also i always assumed you would need a max232 for pc connection 12 v to 5 v or are you just referring to microcontroller rx/tx to serial microcontroller rx/tx driver,5v to 5v(no max232 needed)
do you have source code aswell as hex file. just so i can understand how it works.
(no subject) (by MGP)
I don't have the source code. You can find the hexfile on his website.
All I have is from that website and i am not the owner of that site.
You need an MAX232 if you have at the other end also an MAX232 like an PC AND if the wires are longer than 50cm
I was talking from controller to controller AND wires no longer than 50cm. Most of the time this wil do the job
(no subject) (by MGP)
Something went wrong at row 6.
The number of characters is limited and so was number 8 gone.
Attached the new version.
The 16F628a program is not perfect but good enough to play with it.
(no subject) (by bob dole)
thanks ill try it out over the weekend
(no subject) (by Alex)
Hello i tried it and i got this: (see image)
i tried also that one from "Hobbybotics Serial LCD Controller V3.0" but i canīt figure out why i still canīt get the serial comunication, the interface shows its introducing message, but nothing about the comunication, it is the same with " http://www.freewebs.com/x7jay7x/ ", maybe iīve been doing something wrong the entire time, as far as i know i only need to connect the TX pin from my MCU to the RX pin which is pin 7 in pic16f628A, thatīs all, or am i missing something?.
BTW: im using the example MGP gave in this topic, 20Mhz OSC, 9600 baud rate, pic 16f628A uses internal OSC? because in the schematic im using OSC pins in the LCD and what is its value (Mhz)?, thank you very much.
(no subject) (by Alex)
another image
(no subject) (by MGP)
16F628A internal oscillator is 4Mhz and when using this oscillator you can use pin 7 & 8 as IO-pins.
First check if you have signal on TX (pin8) of the MCU, you can use a LED + 330 ohm resistor.
I hate breadboards when 2 controllers are using the same power supply, you must set a 100nF capacitor directly over the supply pins of the controllers and LCD power pins, also connect a 100ĩF elco on each breadboard.
Decoupling on breadboards is more than nessecary.
(no subject) (by Alex)
i got the 100nF and 100ĩF, it worked but as i still use breadboards and just one power suppy for 2 MCU there will always be noise, sometimes i had to touch some wires for somehow making it work, sometimes as soon as i plugged the power supply also worked, very random situations when using breadboards, so i assume that i made the same mistakes when using the hobbybotics serial lcd interface but it was interesting, i attach the images.
(no subject) (by Alex)
another image, it freezes at 14 i assume the noise.
(no subject) (by Alex)
I am very grateful for your help MGP.
(no subject) (by Alex)
About the Rosc in ldmicro is that the best time for serial comunication?
(no subject) (by MGP)
Be careful if you use a breadboard, make the connections as short as possible, you are working with high-frequency signals.
Power lines as they are now asking for trouble, much too long.
Oscillator Wiring too long
MCRL wire too long
pin 2 is not connected if the button is not pressed.
You will always have problems if you stay working like this.
A breadboard is a source of frustrations if you're not working carefully.
Long connections are a source of annoyance.
The most of your problems come from the long wires and ground loops.
(no subject) (by Alex)
i forgot to remove button in pin 2,i will make it smaller in a PCB and do all you said in this desing, thanks again MGP.
LCD (by SEGAR)
Your LCD Projects its look nice Alex, But i not try out this LCD projects yet, because no I2C support. How YOU DO IN Patiently with ldmicro i really appreciate that you patient. and use breadboards to do LCD projects its really need patient, any how i also need to try out, do no how to start i need support.
thanks
(no subject) (by Alex)
yeah, patience is a virtue, it took a lot of time but i could finally get the comunication with the help of the forum. yeah i would like an I2C support too but we already have enough to make a standard project with LDMICRO an MCUīs.
(no subject) (by Alex)
i recommend you to give it a try with lcd serial communication , then you can make more sophisticated projects :)
(no subject) (by Alex)
To MGP
In the schematic circuit ( http://www.freewebs.com/x7jay7x/), the 4 buttons are only connected to ground and pins of the 16f728A, they donīt have a pull-up resistor, is is like that? or do i have to add pull-up resistors? and what are they for? antenna effect?
(no subject) (by Alex)
and can i avoid the 2n2222 transistor and connect "K" pin of the lcd directly to power supply? due to when i was using both hobbybotics and X7JAY7X's LCD Page brightness was always too low and couldnīt adjust it or see what it displayed . In images i attached before i connected directly to power supply the "K" pin .
(no subject) (by Alex)
in datasheet it says that pic 16f628A (port b) has internal weak pull up resistor, now i see why in schematic there are buttons connected only to ground and pin (pont b).
(no subject) (by MGP)
The 16F628A is programmed in another programming language and there are the internal pull-up resistors activated.
It is only in version 4 of LDmicro that this possibility is standard.
The 2N2222 needs a basis resistor (1K) otherwise you make a short cicruit, better use a mosfet or leave the transistor out and connect the K to the GND via a 100ohm resistor, if there is no resistor on the LCD print.
If you use the buttons you also need to connect the TX (628a) to the RX (MCU).
LCD (by SEGAR)
yes Alex, have to make one and see the results, when free time.
how is your LCD projects as well hope all goes well yeah, i am happy have feedback fast from this forum . thanks for all .
(no subject) (by Alex)
Iīm using 3.5.4, works pretty well while bug in version 4 is being fixed, but i see that 3.5.4 has the option to use internal pull up like version 4, does it work? or it is TODO?
(no subject) (by MGP)
I was wrong, it was from version 3.5.0 and it should work.
(no subject) (by Alex)
To: MGP and SEGAR
i built the circuit on a protoboard PCB (due to i only have enought time to do it on sundays and the electronic store is closed), it seems it works ok, i set a 100nF capacitor directly over the supply pins of the microcontrollers and a 100ĩF elco on breadboard PCB. I also used 2 power supply for each microcontroller.
(no subject) (by Alex)
but nevertheless when using 2 power supply i got this:
(first image is with 1 power supply)
(no subject) (by Alex)
as i said when using 2 power supply:
power supply Nš1 for the 16f877A: 5Vdc - 1500mA (output)
power supply Nš2 for the 16f628A: 5Vdc - 450mA (output)
comunication was wrong, so i decided to use power supply Nš 1 for the entire circuit.
(image power supply Nš2 cables):
(no subject) (by Alex)
pcb image
(no subject) (by Alex)
another image
LCD (by segar)
Hi, Alex
i when i was see your pictures 20161002_191212.jpg,20161002_191518.jpg,20161002_192347.jpg you have made it in prototype board PCB. But i not understand that why you use 2-power supply? for power up this projects, it is you are using one of power supply as your output power ? and you read the energy output consumption? from that power supply?
power supply Nš1 for the 16f877A: 5Vdc - 1500mA (output)
power supply Nš2 for the 16f628A: 5Vdc - 450mA (output)
what this means Alex?
its look pretty good your project.
(no subject) (by Alex)
i used 2 spower supply one for each micro because i missunderstood what MGP said about using 1 power supply for two different breadboards i attached image of protoboards before.
"Use 1 power sypply in PCB."
Now, what i mean with this:
power supply Nš1 for the 16f877A: 5Vdc - 1500mA (output)
power supply Nš2 for the 16f628A: 5Vdc - 450mA (output)
Iīm using power supply from old cellphones (see image)
(no subject) (by Alex)
i was attmepting to implement a clock by using the example given here:
http://cq.cx/ladder-forum.pl?action=viewthread&parent=1867
to experiment with serial lcd interface ( http://www.freewebs.com/x7jay7x/) so i combined clock_example with example MGP gave here, but i canīt clear the introducing message of the interface even if i use \x58 (This command will immediately clear all of the contents of the display) i get the seconds on the introducing message i attach image and ladder logic
(no subject) (by Alex)
ladder logic
(no subject) (by MGP)
Sorry wrong file, here the good one.
(no subject) (by Alex)
yeah i added "\xFE\x58" in the ld attached , in the example you gave you used it once and the lcd cleared.
(no subject) (by Alex)
I added also "\xFE\x58" in row 10, where there is hour, min and sec, it clears the display but time displayed keeps blinking.
(no subject) (by Alex)
even if i use \xFE\x42 (This command turns the display on after the [minutes] timer has expired- took from manual you gave, thanks a lot by the way), it shows the time but it keeps blinking.
(no subject) (by Alex)
im cheking it, previously i managed to show time (see image), also if i pressed mcrl button and time stars wiht introducing message cleared.
(image took after 12 hours approximately)
(no subject) (by Alex)
ld file attach
(no subject) (by Alex)
butt still not ok
(no subject) (by MGP)
It's all about timing.
Try this version.
To Ihor:
If you delete the last 4 OSF's in rung 7, 10, 12, 14 then it does not work anymore.
Is this normal or is this a bug?
(no subject) (by Ihor Nehrutsa)
Where is true pdf for yuors LCD?
In this pdf
254 FE Define custom character 6. This command must be followed by eight data bytes.
???
(no subject) (by Alex)
To MGP:
I tried your ld file and i got this after pressing mclr button (see image)
(should it turn on display after 5 seconds? (\xFE\x42\x05) )
(no subject) (by Alex)
before pressing mclr button (i think no problem pressing mclr button for test anyway)
(no subject) (by MGP)
If I have time I will make the serial display on breadboard this weekend and test it.
I think you still have hardware problems.
(no subject) (by Alex)
I am very grateful MGP, i hope it is that.
On the other hand, i simulated it in proteus 8 and i got the same message like in "2.jpg" attached before. (See image )
(no subject) (by MGP)
The initialization time is greater than imagined, is now 2seconds and it works, see picture.
I have omitted the hours since the 16F628A memory was not big enough.
The version posted here is for a 16F877A.
You do have to switch on the backlight, otherwise the screen remains dark.
You can connect the cathode to the GND, you can see what happens.
Default the backlight is off.
(no subject) (by MGP)
LD-file for the 877.
(no subject) (by MGP)
Hex-file
(no subject) (by Alex)
I am very grateful again MGP, so it was about the timing after all, does the timing depends on the micro i use or the 16f628A serial interface?, and as the 16f628A has no enough memory for the hours i will not be able to simulate a clock with this serial interface at all right?.
I attach image, pretty well.
(no subject) (by MGP)
I was using a 16F628a as sender and not a 16F877 as you do.
As it says in the Ldmicro manual, serial instructions require a lot of memory and a 16F628A has too little.
A 16f877 or 876A will cope the hours prefect because they have 3x more memory.
The timing is not dependent on the controller.
It works now and you can experiment to your heart's content.
Attention, it wil not compile correctly with ldmicroV402, I used version354
(no subject) (by Ihor Nehrutsa)
There is no problem with software.
PIC16F628A work well.
(no subject) (by Alex)
I see; yeah i agree with you MGP; 3.5.4 works pretty well; i think i'll be using it by now; also will post some bugs i have found (i think they are bugs)
(no subject) (by Ihor Nehrutsa)
I am afraid that the AUTO_BANKING and AUTO_PAGING still contain bugs, but this LD compiled in V4.0.2
(no subject) (by Alex)
To Ihor:
I understand you; it is a process and the main function of reporting bugs is to help you; we care your job.
(no subject) (by MGP)
Ihor, I use a 16F628a not a 16F877 for the LDmicro program.
NOW it works and I have tested it again with V402 to see what went wrong yestserday.
It was late and I have not seen that the program was too big for a 628a, see the picture attached, the chip was 102% full.
SO VERSION402 IS WORKING AFTER ALL, sorry, my fault.
(no subject) (by Ihor Nehrutsa)
to MGP
Try this LD with PIC16F628a and V4.0.2
Also you can reduce the hex file if use lot of internals relay instead the 'row' variable.
By the way, 'row' variable should be called 'status'.
In our case name 'row' not meant row of display.
(no subject) (by MGP)
Your program works almost perfect.
Only, you can not use the buttons because the receiving 'A' interfered with the transmitted code.
Sometimes the screen is frozen or the A is displayed when you push the button.
I think you can work arond but this is for later.
(no subject) (by Ihor Nehrutsa)
In Proteus7 SW1 simulated right.
To Alex :
Can yuu test ...example_v5.ld in clock4.zip in Proteus8?
(no subject) (by Alex)
as MGP said it is almost perfect, sometimes i had to plug unplugged power supply twice, because it freezes but then it works ok (it uses a lot of memory but it was always like that).
I am very grateful with both of you
(no subject) (by Alex)
Compiled with 4.0.2v
(no subject) (by MGP)
Alex, a frozen screen was due to the addition of the variable "row", which sometimes numbered higher than 4 by coincidence.
Then also "sec" with "min", a typo
And "cycle = 0" deleted for saving memory and maybe the cause of the fault addition of "row" when a button was pressed.
Now everything works, including the buttons.
(no subject) (by Alex)
To Ihor:
im sorry for being late i test it now clock 4 in proteus 8, image attach
(no subject) (by Ihor Nehrutsa)
to Alex, MGP
I enable MCLR input for PIC16F628
in LCDSERIAL628-v2_2_MCLRE.hex (it allow SW5)
and made a few changes in LD and Proteus model.
Try in hardware.
I think that a frozen screen is due to bugs in the
LCDSERIAL628-_____.hex. See jpg in zip.
LD, HEX's, Proteus model in zip.
(no subject) (by MGP)
Ihor: I will try it this evening, now the weather is too nice, a sunny day ;-)
Btw in rung 13 and 15 you reset 2 times the seconds instead of minutes/seconds, but no need to upload a new ld file.
And I have received you request....
(no subject) (by MGP)
I tested the new LD clock6 program and it works well with a 16F877a on the breadboard.
I have also programmed the LCD pic with LCDSERIAL628-v2_2_MCLRE.hex and it is not a good idea, because if you push button5 then the screen goes dark and resets the controller.
This means that you also have to restart de 877a to clscr and switch on the backlite.
I attached a better hex file because it works better with 2x16 LCDs, the first had too much text.
S1..4 serial buttons working very well, no frozen screens anymore.
(no subject) (by Alex)
i have tested clock6, when i plugged power supply at first sometimes there are wrong numbers o wring signs but it is like it resets automatically after one little moment and then it works ok, always like that, due to that it wokrs ok
(no subject) (by Alex)
i have tested MGP clock6_877a_V2.hex
(no subject) (by Alex)
I plugged and unplugged power supply many times for testing inizialization program, sometimes i got this from MGP file (image attach - a little number 2 over there) , but as long as i donīt use buttons yet maybe there is some hardware problems.
Nevertheless with Ihor hex always in auto reset works ok due to that.
Thanks a lot guys need more to analyze with this great LDmicro program :)
(no subject) (by MGP)
I think that LDmicro still sends the serial text after reset, so the status variable is set to 1 after reset and let running the display.
I made two videos with some changes in de hardware.
- The backlight is always on, Cathode to the GND.
-The red led, on the left replaces the backlight when it is switched on.
I changed the time to 4sec for a better view.
The first video you can see what happens with the original program.
The stopwatch is running before the CLSCR
https://youtu.be/BYRA-PJNFvs
The second video is when I changed the program, I forced the status variable to stay zero as long as the time has not expired. Now its working perfect.
https://youtu.be/GC_WkkAQ6Pk
Attached the new Ld-file and the hex file.
(no subject) (by MGP)
Wrong button grrr..here the LDfile
(no subject) (by MGP)
The hex file...
(no subject) (by Ihor Nehrutsa)
to MPG
You are right. Its my bug.
LDmicro.GitHub news v4.0.4 (by Ihor Nehrutsa)
https://github.com/LDmicro/LDmicro/releases/tag/4.0.4
== Release 4.0.4
* HotFix: Fixed initialization error of all used banks of PIC's RAM from 4.0.1 version.
Not recomended to use with PIC's MCU releases 4.0.1 - 4.0.3.
(no subject) (by MGP)
Ihor, great job man.
Now its like in video 2 and now you can start the stopwatch after 750mS, I tried it with 500mS but that is too fast.
I have also the impression that the the LCD serial buttons reacting better on the stopwatch than the 877a buttons, I dont know why yet, but for now it suffices.
I wonder if you can use (T) and (s) on the same coil?
Attached the 750mS delay program.
(no subject) (by Ihor Nehrutsa)
to MGP
1)You can try to increase T1, T2 anti bounce timers up
to 30..50 ms.
2) Terminology:
"Level sensitive" = output(element) controlled by the level of the input.
"Edge triggered" = output changes only at the point in time
when the input changes from value to the other. Can be positive
edge-triggered (0 to 1), or negative edge-triggered (1 to 0).
Most elements of LDmicro are "Level sensitive", some elements are
"positive edge-triggered".
The several coils with the same 'YName' can be mentally represented as a one microchip with multiple inputs and one output. Normal and inverted input are directly transfers the input state (normal or inverted) to the output. R, S, T inputs lock up (latch) the state of output.
The T input is positive edge triggered. R, S inputs are level sensitive.
If before R, S insert the "OSR: ONE-SHOT RISING" or "OSF: ONE-SHOT FALLING" you get a "positive edge triggered" element. If used only the R and S inputs you get classic RS-trigger. If add T you get newest RST-trigger. May be several R..R inputs, or several S..S inputs. You can use any combination of inputs for one 'YName' coil.
(no subject) (by MGP)
Now I understand what you wrote there and how I can handle coils.
Thanks for explained it to me in detail.
Something to incorporate in de changes.txt as note.
As for the buttons, increasing delays works less well, but I'll try again later, then maybe I have more information about that.
And maybe its time to open a new topic, this one is already too big ;-)
(no subject) (by MGP)
Ihor, there was a button with a bad contact, that is the reason why I had problems to stop the stopwatch sometimes with the 877a buttons.
Now the buttons all working well.
Post a reply to this comment:
|