RS232 communication between PC and an AVR in mikroPascal

Discussion on projects that are created by users and posted on mikroElektronika website.
Author
Message
mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#16 Post by mikroSeven » 08 Jul 2016 19:28

The lazarus part:
Attachments
uart b.jpg
uart b.jpg (54.39 KiB) Viewed 14821 times
Last edited by mikroSeven on 08 Jul 2016 19:31, edited 2 times in total.
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#17 Post by mikroSeven » 08 Jul 2016 19:30

uart a.jpg
uart a.jpg (25.49 KiB) Viewed 14821 times
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#18 Post by mikroSeven » 08 Jul 2016 19:33

After the Lazarus part has started, the next aperas on the Arduimo/LCD;
uartc.jpg
uartc.jpg (27.47 KiB) Viewed 14821 times
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#19 Post by mikroSeven » 08 Jul 2016 19:36

What it DOES show very well, is the funcionality of the so called Delimiter, in the procedure:

procedure UART_Read_Text(var Output : string[255]; var Delimiter : sting[10]; Attempts : byte);

I used the string '56' and the Arduino DID it ok!
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#20 Post by mikroSeven » 08 Jul 2016 19:38

I placed the following allready before:

Oh I',m verry sorry!

I wasn't aware of any Arduino shields of MikroElektronica, www.mikroe.com !

To all readers of this topic: my shield is not from MilroElektronica, www.mikroe.com !

Sorry for any inconvenience!

All regards. Marcel
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#21 Post by mikroSeven » 09 Jul 2016 17:50

Transmitting from Lazarus to Arduino needs more investigation.
More next week

By the way: the Serial-UART-Terminal built within the mikroPascal-DE, is very useful!
Very nice tool to test RS232!
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#22 Post by mikroSeven » 19 Jul 2016 10:26

Hallo zusammen.

Erste RS232-Komunication zwischen pc-Lazarus und Arduino2560-mikroPascal functioniert!

In Lazarus wende (uses) ich LazSerial und Synaser an.

M.f.G.
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#23 Post by mikroSeven » 21 Jul 2016 10:06

So far, so good!

Using a LazarusTimerComponent and send the pc-time to Arduino and get it displayed on an LCD.

Also have a LazarusControlBar and when moving by mousepointer, a LEDbar at Arduino shows the Progress.

Very nice! It's getting better each time! :D :D :D

Gonna practis/studdie more and then get my robotArm controllled by pc-Lazarus and Arduino-mikroPascal!

( it's still using pc-DOS/Turbopascal7.0 and ISA-82c55a )
001b.jpg
001b.jpg (30.71 KiB) Viewed 14787 times

Picture is showing 2 extra characters at beginnning of the string. Is due of something called 'AnsiChar'.
Partly solved: for the time being, I just removed the 2 chars at Arduino side.
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#24 Post by mikroSeven » 03 Aug 2016 09:27

Finaly , my setup for my robotArm, will be like this:

Got some Arduino's etc laying around, gonna use them!


setu uB 02.jpg
setu uB 02.jpg (196.8 KiB) Viewed 13918 times
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#25 Post by mikroSeven » 08 Aug 2016 18:29

Abend!

Dat mach ja richtig spass!

Von PC zu LED's!
bar control 1.jpg
bar control 1.jpg (48.81 KiB) Viewed 13911 times
bar control 2.jpg
bar control 2.jpg (59.61 KiB) Viewed 13911 times
To DIY or not to DIY

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: RS232 communication between PC and an AVR in mikroPascal

#26 Post by biljana.nedeljkovic » 09 Aug 2016 11:50

Hi,

I am glad your project is moving to the right direction, and the communication is working.

It would be great, once you wrap up and finish it, to post it on Libstock.
http://libstock.mikroe.com/

Kind regards,
Biljana

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#27 Post by mikroSeven » 12 Aug 2016 14:44

Tnx!
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#28 Post by mikroSeven » 18 Aug 2016 20:31

Not much progress last weeks, here a video-shot, Lazarus-To-Arduino.

Next step: ADC-values ( mini-joysticks ) form Arduino-To-Lazarus.



https://www.youtube.com/watch?v=RZIEMfN ... EpFg4GsRwI
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#29 Post by mikroSeven » 02 Sep 2016 09:55

So, got something working stable!

PC-Lazarus, is kinda 'Master' and Arduino is kinda 'Slave'.

Lazarus sending each 100ms, Arduino waiting for data and sends it back...


Not the actual value of the ScrollBars are send but a 'kinda 'derivative' value to show a Sollid Led-BAR.

Like this scheme:
  • // 0 1 2 3 4 5 6 7 led
    // 1 2 4 8 16 32 64 128 bin
    // 0 1 3 7 15 31 63 127 dec
    //16 48 80 112 144 176 208 240 tres


myrs232.jpg
myrs232.jpg (90.22 KiB) Viewed 11697 times
To DIY or not to DIY

mikroSeven
Posts: 161
Joined: 14 Mar 2016 10:24
Contact:

Re: RS232 communication between PC and an AVR in mikroPascal

#30 Post by mikroSeven » 02 Sep 2016 10:12

For the time being,
I refer to this next topic on an forum outside of mikroE, including posts of myself, for more information and explanation of the Lazarus part.


http://forum.lazarus.freepascal.org/ind ... #msg220762


All regards!
To DIY or not to DIY

Post Reply

Return to “User Projects”