![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| New Member | 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 |
| | |
| | (permalink) |
| Super Moderator | Check my tutorials. |
| | |
| | (permalink) |
| New Member | thanks but all your tuto's are in ASM and i seek in basic or C |
| | |
| | (permalink) |
| Super Moderator | But you never mentioned that?, and you still haven't mentioned what dialect of the languages you're looking for. |
| | |
| | (permalink) | |
| New Member | heu i have said Quote:
| |
| | |
| | (permalink) |
| Experienced Member | 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? Last edited by mister_e; 4th May 2008 at 09:52 PM. |
| | |
| | (permalink) |
| Experienced Member | 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 |
| | |
| | (permalink) | |
| Experienced Member | Quote:
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 | |
| | |
| | (permalink) | |
| New Member | 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:
i use pbp compiler pro your example isn't complet :s Last edited by xavierbe; 5th May 2008 at 05:24 PM. | |
| | |
| | (permalink) |
| Experienced Member | 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 Last edited by mister_e; 5th May 2008 at 07:35 PM. |
| | |
| | (permalink) | |
| Experienced Member | 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:
__________________ Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground | |
| | |
| | (permalink) |
| Experienced Member | USART interrupt would be better |
| | |
| | (permalink) |
| New Member | 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 ^^ |
| | |
| | (permalink) |
| Experienced Member | eremm UART: Universal Asynchronous Receiver/Transmitter USART: Universal Synchronous Asynchronous Receiver Transmitter We can also use synchronous here -BaC
__________________ Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground |
| | |
| | (permalink) | |
| Experienced Member | Quote:
__________________ I can still log in! Delete my account and all my post now. | |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| 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 |