Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 4th May 2008, 07:08 PM   (permalink)
New Member
xavierbe is on a distinguished road
Default Microcontroller Basic RS232

Hi,

( sorry for my bad english )

i have a question

who can i communicate in basic from à pic to another pic
16F628

I will do a test
I take 2 micro

1 send anything on first and on the other one recive on the sec (RX-TX)

but i can't program it

i don't know the instructions and i didn't found it on the web and on french forums



if anyone have à little peace of code to show how to sends data
on RX TX


that ( serait ) helpfull


thank you
xavierbe is offline   Reply With Quote
Old 4th May 2008, 07:27 PM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Check my tutorials.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 4th May 2008, 07:56 PM   (permalink)
New Member
xavierbe is on a distinguished road
Default

thanks but all your tuto's are in ASM

and i seek in basic or C
xavierbe is offline   Reply With Quote
Old 4th May 2008, 08:08 PM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

But you never mentioned that?, and you still haven't mentioned what dialect of the languages you're looking for.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 4th May 2008, 08:19 PM   (permalink)
New Member
xavierbe is on a distinguished road
Default

heu i have said
Quote:
Originally Posted by xavierbe
Hi,

who can i communicate in basic from à pic to another pic
16F628
sorry ( i can't good speak english only read )
xavierbe is offline   Reply With Quote
Old 4th May 2008, 09:50 PM   (permalink)
Experienced Member
mister_e is on a distinguished road
Default

Xavier, that's a French name, there's also this 'à' in his previous quote... "and on french forums" and finally (serait) in his first message soooooooooooooo... so i'm pretty sure Xavier is French... like me

Xavier, which compiler(s) are you using?
__________________
Steve
______________________
info@mister-e.org
www.mister-e.org

Last edited by mister_e; 4th May 2008 at 09:52 PM.
mister_e is offline   Reply With Quote
Old 5th May 2008, 02:25 AM   (permalink)
Experienced Member
ronsimpson is just really niceronsimpson is just really niceronsimpson is just really nice
Default

I use Pic Basic Pro. (software compiler) (BASIC)
You can download the manual.

PIC-1 has 8 buttons connected to an 8 bit port. It any button or buttons are pushed data is sent. 1110111= is button 4, 1110011= button 4,3 is pushed.
Data format = $,data,1/data,CR or $,11101111,00010000,CR
If data is sent then it is output on portB.
If no data is sent for 0.3 seconds then 11111111 is output on portB.

Here is most of the software for the receiver. (PIC-2)
'************************************************* *********
'data= $, buttons, 1/buttons, CR
'button 5 pressed = $, 11101111, 00010000, CR
'if no command in .3 sec then release all buttons
'if button and 1/buttons do not equal or no CR then error
'************************************************* *********
receiveloop:
HSERIN 300,timeout,[wait ("$")] '
hserin 30,timeout,[char1, char3]
'The Rx will wait for the $ then load from there.
high errorled 'turn off error led
if char3 <> cr then
low errorled 'indicate error
goto receiveloop
else
portb=char1 'push buttons
goto receiveloop
endif
timeout:
portb=$ff 'no buttons
high errorled 'reset error
toggle test 'test
goto receiveloop
ronsimpson is offline   Reply With Quote
Old 5th May 2008, 06:59 AM   (permalink)
Experienced Member
 
Blog Entries: 2
gramo is just really nicegramo is just really nicegramo is just really nicegramo is just really nice
Default

Quote:
Originally Posted by xavierbe
1 send anything on first and on the other one recive on the sec (RX-TX)

but i can't program it

i don't know the instructions and i didn't found it on the web and on french forums

There's deffinetly heaps of info for em out there, not sure exatly what your application is , but just wondering if you have ever programmed a PIC before or used a higher language in the past to program your PIC's?
__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline   Reply With Quote
Old 5th May 2008, 02:06 PM   (permalink)
New Member
xavierbe is on a distinguished road
Default

i have already programed (16f876) PIC
in Basic and in C
little things - LCD,LED,...,etc.

the application is

in the first time transmit INT or DOUBLE from a pic to an other pic
then in a second time transmit CHAR
and in the third time

send data from RS232 <-> PIC
with the physical UART from the pic (16f876)


i prefer program in BASIC but C is not a problem
but not ASM

Quote:
Originally Posted by mister_e
Xavier, that's a French name, there's also this 'à' in his previous quote... "and on french forums" and finally (serait) in his first message soooooooooooooo... so i'm pretty sure Xavier is French... like me

Xavier, which compiler(s) are you using?
yes i'm french ^^

i use pbp compiler pro


your example isn't complet :s

Last edited by xavierbe; 5th May 2008 at 05:24 PM.
xavierbe is offline   Reply With Quote
Old 5th May 2008, 07:33 PM   (permalink)
Experienced Member
mister_e is on a distinguished road
Default

Ok then, you'll need to use HSERIN/HSEROUT if you want to use the Built-in USART, DEBUG/SEROUT/SEROUT2 etc etc if you want to use specific pins.

Ron gave you something to start, there's a few example in the manual, few on Melabs Website, and tons on the Melabs PicBasic forum
http://www.picbasic.co.uk/forum/

HTH
__________________
Steve
______________________
info@mister-e.org
www.mister-e.org

Last edited by mister_e; 5th May 2008 at 07:35 PM.
mister_e is offline   Reply With Quote
Old 5th May 2008, 07:43 PM   (permalink)
Experienced Member
 
BaCaRdi is a jewel in the roughBaCaRdi is a jewel in the rough
Default

Couldn't you use a external on change interrupt to know when serial data is incoming, I would think this would make more sense instead of always checking for incoming data, well that is how I do it. But then again we don't know the big picture here.

-BaC
Quote:
Originally Posted by ronsimpson
I use Pic Basic Pro. (software compiler) (BASIC)
You can download the manual.

PIC-1 has 8 buttons connected to an 8 bit port. It any button or buttons are pushed data is sent. 1110111= is button 4, 1110011= button 4,3 is pushed.
Data format = $,data,1/data,CR or $,11101111,00010000,CR
If data is sent then it is output on portB.
If no data is sent for 0.3 seconds then 11111111 is output on portB.

Here is most of the software for the receiver. (PIC-2)
'************************************************* *********
'data= $, buttons, 1/buttons, CR
'button 5 pressed = $, 11101111, 00010000, CR
'if no command in .3 sec then release all buttons
'if button and 1/buttons do not equal or no CR then error
'************************************************* *********
receiveloop:
HSERIN 300,timeout,[wait ("$")] '
hserin 30,timeout,[char1, char3]
'The Rx will wait for the $ then load from there.
high errorled 'turn off error led
if char3 <> cr then
low errorled 'indicate error
goto receiveloop
else
portb=char1 'push buttons
goto receiveloop
endif
timeout:
portb=$ff 'no buttons
high errorled 'reset error
toggle test 'test
goto receiveloop
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"...
Information Underground
BaCaRdi is offline   Reply With Quote
Old 6th May 2008, 04:03 AM   (permalink)
Experienced Member
mister_e is on a distinguished road
Default

USART interrupt would be better
__________________
Steve
______________________
info@mister-e.org
www.mister-e.org
mister_e is offline   Reply With Quote
Old 7th May 2008, 09:09 PM   (permalink)
New Member
xavierbe is on a distinguished road
Default

why usart ?and not use the uart ( it is integrated in my 16f872)

i will in a first time just
run a little program
who

send a Char

from one pic to another with RX TX

so i see the settings from the registers
and so i cam upgrade this code (basic)
for my application ^^
xavierbe is offline   Reply With Quote
Old 7th May 2008, 10:53 PM   (permalink)
Experienced Member
 
BaCaRdi is a jewel in the roughBaCaRdi is a jewel in the rough
Default

eremm

UART: Universal Asynchronous Receiver/Transmitter
USART: Universal Synchronous Asynchronous Receiver Transmitter
We can also use synchronous here We beat you ;Þ

-BaC
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"...
Information Underground
BaCaRdi is offline   Reply With Quote
Old 8th May 2008, 04:56 AM   (permalink)
Experienced Member
 
donniedj has a spectacular aura about
Default

Quote:
Originally Posted by xavierbe
thanks but all your tuto's are in ASM...
Tough 7890
__________________
I can still log in! Delete my account and all my post now.
donniedj is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Microcontroller BASIC benchmark? Any code out there? blueroomelectronics Micro Controllers 1 24th December 2007 02:05 PM
Visual BAsic communications with a microcontroller Erwin_Macaraig Micro Controllers 2 22nd November 2004 12:11 AM
Help Open Collector Rs232 Uart microcontroller mitchjs Electronic Projects Design/Ideas/Reviews 7 7th August 2004 01:35 PM
microcontroller, basic stamp or PIC...which one u prefer? kumar_3k Micro Controllers 0 25th March 2004 09:49 PM
PIC Basic Plus and RS232 problem again. Help!!! Beefer3 Micro Controllers 1 14th November 2003 11:07 PM



All times are GMT. The time now is 12:07 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.