Princejude's Posts
Nairaland Forum › Princejude's Profile › Princejude's Posts
1 2 3 4 5 6 7 8 ... 13 14 15 16 17 18 19 20 (of 20 pages)
hopefullman: Thanks.what of the usb comunication.is it different to that of rs232USB communication is diferent from serial or rs232 comminication. Right now we are on serial not usb. Usb may come later. |
I2C The inter-integrated circuit (I2C) bus is designed for short-range communication between chips in the same system using a software addressing system. It requires only two signal wires and operates like a simplified local area network. The I2C slave chips are attached to a two-wire bus, which is pulled up to logic 1 when idle. Passive slave devices have their register or location addresses determined by a combination of external input address code pins and fixed internal decoding. If several memory devices are connected to the bus, they can be mapped into a continuous address space. The master sends data in 8-bit blocks, with a synchronous clock pulse alongside each bit. As for SPI, the clock is derived from the instruction clock, up to 5 MHz at the maximum clock rate of 20 MHz. To send a data byte, the master first sends a control code to set up the transfer, then the 8-bit or 10-bit address code, and finally the data. Each byte has a start and acknowledge bit, and each byte must be acknowledged before the next is sent, to improve reliability. https://img163.imageshack.us/img163/8949/7mx.png I2C Connection |
SPI The serial peripheral interface (SPI) bus provides high-speed synchronous data exchange over relatively short distances (typically within a set of connected boards), using a master/slave system with hardware slave selection. One processor must act as a master, generating the clock. Others act as slaves, using the master clock for timing the data send and receive. The slaves can be other microcontrollers or peripherals with an SPI interface. The SPI signals are Serial Clock (SCK) Serial Data In (SDI) Serial Data Out (SDO) Slave Select (!SS) To transfer data, the master selects a slave device to talk to, by taking its SS line low. Eight data bits are then clocked in or out of the slave SPI shift register to or from the master. No start and stop bits are necessary, and it is much faster than RS232. The clock signal runs at the same speed as the master instruction clock, that is, 5MHz when the chip is running at the maximum 20 MHz (16 series MCUs). https://img689.imageshack.us/img689/8162/7st.png SPI Connection |
LESSON 7: Serial Communication Serial data connections are useful because only one or two signal wires are needed, compared with at least eight data lines for a parallel bus plus control signals. The typical PIC microcontroller offers a choice of serial interfaces. The best one for any given communication channel depends on the distance between nodes, the speed, and the number of hardware connections required. Types of Serial Communication USART SPI 12C USART The universal synchronous/asynchronous receive transmit (USART) device is typically used in asynchronous mode to implement off-board, one-to-one connections. The term asynchronous means no separate clock signal is needed to time the data reception, so only a data send, data receive, and ground wires are needed. It is quick and simple to implement if a limited data bandwidth is acceptable. A common application is connecting the PIC chip to a host PC for uploading data acquired by the MCU subsystem. The USART link can send data up to 100 meters by converting the signal to higher-voltage levels (typically 12V). The digital signal is inverted and shifted to become bipolar (symmetrical about 0V, line negative when inactive) for transmission. The PIC 16F887 has a dedicated hardware RS232 port, but CCS C allows any pin to be set up as an RS232 port, providing functions to generate the signals in software. The basic form of the signal has 8 data bits and a stop and start bit. The bit period is set by the baud rate. A typical value is 9600 baud, which is about 10k bits per second. The bit period is then about 100μs, about 1 byte per millisecond, or 1K byte per second. The data are transferred between shift registers operating at the same bit rate; the receiver has to be initialized to the same baud setting as the transmitter. Assuming we are looking at TTL level data, in the idle state, the line is high. When it goes low, the receiver clock is started, the data are sampled in the middle of each following data bit period, and data are shifted into the receive register https://img545.imageshack.us/img545/9760/e7ee.png USART Operation |
I added the "org 00" line to your code and it compiled successfully. Note the org statement is used to initialize the code. Always include it in all your asm code.
|
@ CogitoErgo That is not a complete code. Post your complete code so that we may help you to debug it and I also want to tell you that I don't use asm frequently. The last project I did with asm is up to a year now. Why do you prefer asm? You can try this nice electronics site http://www.talkingelectronics.com/te_interactive_index.html They used asm in their PIC sections. Just scroll down the site to the PIC sections... |
bosunsky: pls, can u send me the list of all the basic tools i need, that can get me started, i'm very sorry i ask cos av not been following this thread b4.It all depends on the type of microcontroller you want to learn with such as PIC, 8051 or AVR. You will need the development kit and the programmer
|
bosunsky: Where in ibadan can i get all the tools needed to start dis microcontroller program, av been waiting for this all long!!!!!!Send the list of the tools you need to microscale embedded(or you can post the list on this thread) and pay into their account( add N2000 for shipment), then they will send your tools in less than 48 hours after they have confirm your payment. |
[quote author=Java_Prince] Mahn I will have to think over it. I really would love to be bulding robotic machines with my object oriented mindset. [color=#000000] [font=Lucida Sans Unicode][/font][/color][/quote]May be you can try using Arduino with AVR microcontroller http://arduino.cc/en/Tutorial/HomePage. It looks like object oriented I have not use it before and you have to check where and how to get the Arduino development kit. If you want to switch to the normal embedded c,you can start from downloading the ebooks I have uploaded in this thread. |
hopefullman: @prince jude.pls hw can i get the pickit3 programer?my location is akure?dnt mail me 2ru nl cos dmail is dormant.my working mail is truetalk360@yahoo.com.thank uI have sent you a mail. Once we confirm your payment you will get your parcel in the next 24 to 48 hrs |
[quote author=Java_Prince] Are you trying to say that only projects that has to programmed in java is such that must be controlled with GUI ...?[/quote]Yes we did one using c#. I don't know if there is any other way to use java with mcu. May be u can ask mr. google |
[quote author=Java_Prince] But my mentor has told me that java can also be used in the programming of microcontrolers.[/quote]You can use java or c# in microcontroller projects to design GUI(graphical user interface) if your project need to be controlled from a PC . Note that the java or c# is only used on the PC based GUI which will be interfaced to the microcontroller through serial comunication. The microcontroller must have its code written in another language such as c or asm |
Smart card or electronic id card is still part of embedded system. Contact them and tell them what you want. I think they can help you in components sourcing,programming and building of the system. Open there facebook page www.facebook.com/microscale then scroll down, you will see one biometric attendance system as one of their product. |
Have you try Microscale at www.microscale-embedded.com ? |
Otuabaroku: Instead of that ,why not look at accomplishing your task using embedded system. You can easily achieve this using FPGA.The advantage of using embedded system is its speed and cost.@ Otu... Have you use FPGA ? |
boko are rams: U should have snapped some pics to validate ur story.I am sorry,I don't believe ur storyIt is true bro ! See pictures here: http://www.thisdaylive.com/articles/bomb-scare-in-kaduna/149763/ http://www.ngrguardiannews.com/index.php?option=com_content&view=article&id=123960:bomb-blast-averted-in-kaduna&catid=1:national&Itemid=559 http://www.punchng.com/news/police-avert-fresh-bomb-attack-in-kaduna/ Reporting live and direct from Kd city... |
Good Boi: I am currently learning C++ and am interested in microcontrollers and embedded system, I want to know if C++ is sufficient for microcontroller programming, as in without cIf you have any C++ compiler that can convert your C++ code to HEX file then you can use it for microcontrollers. I have not seen such compiler. Note that C++ and C are very similar, so if you know how to code with C++ you can easily switch to embedded C. Download the ebooks I have uploaded in this thread and study them and you will see their similarities. Also search for other microcontroller based ebooks that will help you to learn C. |
hopefullman: @princejude What's d diff btwn pickit2 & pickit3.thank uPickit3 is the elder brother to Pickit2. It is the latest programmer from microchip. The major difference is that PICkit3 can program most of the current PICs and dsPICs while PICkit2 may not program all the current PICs and dsPICs. |
Please do we have cnc programmers in the house? I will like us to share some ideas so that we can learn from others. I am new in CNC programming but from my little research it seems like it will help in PCB fabrication. I have been into PCB design for years but we always do the fabrication overseas. I will like to start the automated fabrication in Nigeria. I have been searching on where and how to buy a cnc machine. The most positive result I have found is proxxon mf70 milling machine plus cnc conversion kit. If you can combine the two,then you are on the right path. I have found where to buy mf70 (around 95k) in Lagos but I have not seen the cnc conversion kit. Pls has anyone use the mf70 and conversion kit? I have started reading about cnc g-code. Note: CNC machine means Computer Numerical Control Machine. |
Which compiler are you using ? It is also better to post a complete, compileable and simple code. |
cogitoErgo: The development board I have(from microscale) can only work with 18, 28 and 40 pin PICsHow did you get their kit ? Did you go to their office or you buy it online (and they send it to you). If it was online,how many days did it take you to get the kit after payment? And where is your location (State). |
From the CD, open the PICKIT2 USER MANUAL, turn to page 27 to see the circuit below: https://i44.tinypic.com/2up74t1.png Wire the circuit in your bread board connect your programmer and you are good to go. [s]Or you can buy their new dev. kit. It has the 8-PIN chip socket[/s] |
cogitoErgo: Thanks a lot. Yea, I have the CCS manual, I will check it again. ThanksIt is called SIL Header (ie. Single-In-Line Header Connector) The one with pins is the male while The one with holes is female |
cogitoErgo: @princejude, assuming i want multiple analog inputs, can i do this?No it won't work like that, do is this way:setup_adc_ports(sAN0, sAN1) setup_adc_ports(sAN0|sAN1); and corresponding channelsNo, you set each channel individually as shown below:set_adc_channels(0, 1) set_adc_channel(0); or set_adc_channel(1); Have you download the CCS manual I posted the link earlier. If yes read the ADC section. Alternatively, you can also do the adc setups from the pic wizard. |
cogitoErgo: Ha, which one be Proteus? I saw everytng except dat Proteus! some of d examples will nid aditional pats and I also want to build external power source fo the the breadboard which will b adapted fo final package later.Proteus is a simulator that can be used to simulate your code without any hardware or kit(ok maybe it was not suppose to be included in your pack because you can use your kit to test your codes). The 128x64 Graphic LCD was not included (optional)because of its cost(around N4000).So if your really want to use it, you can buy one and fix it on its connector in your development kit. Sorry we are just trying to reduce the price of the kits so that it can be affordable for students. Note the N15000 you paid was for both the PIC development kit and the ISCP programmer. |
cogitoErgo: Thanks. I have already gotten it working! I changed the jumper from W2 to W1 to enable the 7-segment(I did that by trial and error, noting carefully I could spoil things ).Did you see the Pic Development Kit user manual and software (CCS C Compiler, MPLAB, Proteus) in the CD? If yes, try all the sample codes |
cogitoErgo: Im using the PIC dev. kit I got from microscale-embedded!Which of the kits ? The one with on-board ISP programmer or the one without ? The kits have a user manual that explains how to use them in a CD with some sample codes. Study the manual, there is a jumper used to enable the 7-segment and other peripherals. Maybe you only enabled the LEDs. Note that the LEDs and 7-segments are connected on the same port. |
cogitoErgo: @princejude, I tried example 5 but instead of the 7-segment to come on, it was the led that was flashing!Are you testing it with a development kit or with a soldered(vero)board? If you are using dev. kit can you post the link to the kit. We will like to know about your hardware. |
cogitoErgo: @princejude or anybody, please how many times can I erase and re-write PIC16f887? Please do not refer me to the datasheet, just give me the answer here! ThanksYou can erase and re-write more than a million times |
. |
EXAMPLE 6: 00 - 99 Counter
|
SEVEN SEGMENT DISPLAY The segments in a 7-segment display are arranged to form a single digit from 0 to F as shown in the figure below: https://i39.tinypic.com/280cpf.jpg Segments are marked with non-capital letters: a, b, c, d, e, f, g and dp, where dp is the decimal point. The 8 LEDs inside each display can be arranged with a common cathode or common anode. With a common cathode display, the common cathode must be connected to the 0V rail and the LEDs are turned on with a logic one. Common anode displays must have the common anode connected to the +5V rail. The segments are turned on with a logic zero. To display these numbers, the following LED segments will be ON 0 = a,b,c,d,e,f 1 = b,c 2 = a,b,d,e,g 3 = a,b,c,d,g 4 = b,c,f,g 5 = a,c,d,f,g 6 = a,c,d,e,f,g 7 = a,b,c 8 = a,b,c,d,e,f,g 9 = a,b,c,f,g Digit coding for Common Cathode https://i42.tinypic.com/9sq97p.png Digit coding for common anode https://i44.tinypic.com/ieij4o.png Example 5: 0 to 9 Counter This sample counts from 0 to 9 on a single digit common anode 7-segment display
|
