Rickey's World of Microcontrollers & Microprocessors : Forum / threads http://www.8051projects.net/ Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet. en-gb 2024-03-29T00:49:26+05:30 contact@nospam.com hourly 1 2000-01-01T12:00+00:00 HC-SR04 displaying random stuff after range 9 http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65870 2024-03-29T00:49:26+05:30 bhantadox Im using 8051, LM016L and HC-SR04 for range finder but after range 9 it starts to display random stuff. 8051 keypad and LED question http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65868 2024-03-29T00:49:26+05:30 fortresmaximus Hi guys, i am new here. I need to create project with microcontroller 8051,in project i want to use KEYPAD-PHONE and 4 LED (for example if i click 1 on keypad - first LED will light up, Could someone give me a hint what i am doing wrong? 8051/ 8052 Microcontroller Code Site. http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65867 2024-03-29T00:49:26+05:30 Tressie Just a quick note to let everyone know that my 8051/ 8052 Microcontroller Code distribution website is back online, and has a new home at:https://green.bug-eyed.monster/Please feel free to stop by, grab some handy code projects, and leave a comment or two.It's a new website, with no PR as yet, so helping to popularise the site by linking to it, will help everyone know it's available.T. Erasing AT89S52 error http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65866 2024-03-29T00:49:26+05:30 cainho07 Hello everyone!I recently bought a brand new AT89S52 and an USBasp programmer for practicing and studying. Took a lot of time to get everything working between drivers and USBasp firmwares until I finally made it but unfortunately, I think I accidentally wrote the lock bits because I didn't check the lock option. Now it says that Mode 3 lock is active with B1 = 1 and B2 = 0. I've hit the erase chip button many times but when I read the lock bits status, it always remain the same. Apparently, the new .hex files are working when I try to write but is there a way to really erase the chip or did I brick it? Thanks in advance! AT89LP2052 connection http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65855 2024-03-29T00:49:26+05:30 Mirza123 Hello!i am trying to use AT89LP2052 ( AT89LP2052 http://ww1.microchip.com/downloads/en/devicedoc/doc3547.pdf) for LED to turn on and OFF. but i am confused with the connections.I have used i have loaded the program by using 8051Flash program. For writing the program i have used 8051-Ready board(https://download.mikroe.com/documents/starter-boards/ready/8051/8051ready-manual-v100.pdf) and mikroprog-8051 (https://www.mikroe.com/mikroprog-8051).here is the code which i have learnt from your course. #include<reg51.h> // for 11.0592MHz Crystal void delay(unsigned int count) { unsigned int i; while(count) { i=115; while(i> 0) i--; count--; } } void main() { while(1) { P1 = 0x00; delay(1000); P1 = 0xff; delay(1000); } } Can you please help me with the connection? Need help with Schematics http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65848 2024-03-29T00:49:26+05:30 cerouno I am working on Smart parking project. Here is my schematic. I sent this to my professor and he said it is not right, i am not sure why. Also he said if i connect this to power source it will burn the source. I am new at this so i really need help. What am i doin wrong? 8051 MULTIPLICATION http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65847 2024-03-29T00:49:26+05:30 xrxx BCD MULTIPLICATIONAssume that you have to 2 BCD numbers in 2 registers/memory locations. Write a subroutine to multiply these 2 numbers and put the result in a different register set/memory location. The maximum number can be 9801 (99*99=9801). So you need 2 bytes to store 4-BCD digits.Execute your program in the simulator and get screenshots at several steps during the execution.Put your code and screenhots in a zip file seperately and submit the zip file as name_surname_id_hw1.zipSWAP is good instruction to switch lower and higher nibbles (4-bits) in A.Repeat the steps we follow on the paper.Guys, can u help me for this? pleaseeeee problem real pic simulator MPLabx http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65841 2024-03-29T00:49:26+05:30 rogermado Hello everyone, sorry in advance if i'm not in the right section of the forum to ask this question : Well, i'm making a school project based on the PIC16F877A. And i have already written the code in MPLabx IDE 5.35. I've simulated it on MPLabX and it worked just fine! the problem is when i use the software "REAL PIC SIMULATOR" i'm not able to make it work. The 7seg display stucks and the results i'm waiting are pretty weird and impredictable. By the way, i build the code i wrote on MPLAB in a hex file then i opened it on Real Pic Simulator.I wonder if there is a "good" way to go from MBLab to Real pic simulator with no problems along the way. Thank you very much in advance for your help,RogerMado PIC X IDE Debugger speed http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65839 2024-03-29T00:49:26+05:30 PHANTOM28 Hi.I hope you all can help me. I am relatively new to the pic microcontrollers and haven't used one in many years. Just so I can familiarize myself I am just going through simple C routines before doing something more interesting. I have loaded Microchip X IDE (V5.30) and done a very simple C program that shifts 1 bit on PORTB one at a time at a time. It complies and works no problem. When in simulator mode (debugger) I can single step through it, but when running I would like the speed of the debugger to be very slow about 2 seconds before it executes the next instructs, so I can see the output values rather (a bit like single stepping) also like to see which line is being executed. I used to be able to do this in MPLAB IDE V8.63. It's driving me crazy, I've checked all option but cannot see how to do that. Greenhouse Monitoring http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65835 2024-03-29T00:49:26+05:30 sarrahjuzar I have a gsm module sim900a and dht22 connected to pic16f877a. Is it possible to interface gsm module to an IoT platform like Thingspeak to display the temperature data? Cheap_Flash_FS(Normal Revision)--Embedded FAT16/32 file system code for free download http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65832 2024-03-29T00:49:26+05:30 figureyang Cheap_Flash_FS(Normal Revision)--Embedded FAT16/32 file system code for free downloadThis code is compatible with FAT16/FAT32 file system totally 2 formats,compatible with long file name.compatible with chinese file name(compatible with GB2312/UNICODE transition codepage).compatible with subdirectory,in support of file reading,writing,deleting,creating ect.. and related function.other,the code is write by C code,can port to other-platforms to achieve file system module.this code is we provided free code, the user can free testing,researching,appling it.and also allowed used on commercial product.this code has fast verstion,can write 1000 sectors one time and more, is suitable for high-level platform.FAT fast version code--leading architect,more fast performance.the fast version is also in the attachment for you with free use.if you need contact with author,please use the following methode-mail:292942278@qq.com or tony_yang123@sina.com.cn How can i calculate minimum ISR interval for nuvoton -8051(8bit)? http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65831 2024-03-29T00:49:26+05:30 wounder From below sample code for nuvoton 8051 timer0 mode 0, the isr interval is calculated is 1ms,its work. but how can I calculate the minimum isr timer interval for 16mhZ frequency.?#define TH0_INIT 0x1A //1.0ms@XTAL=16MH#define TL0_INIT 0xECwhile loading these hex values gets 1ms Isr interval. I was tried 5-microsecond calculation for timer 0, but not get the correct 5uS interval. #include "N76E003.h" #include "Common.h" #include "Delay.h" #include "SFR_Macro.h" #include "Function_define.h" #define TH0_INIT 0x1A //1.0ms@XTAL=16MH #define TL0_INIT 0xEC #define TH1_INIT 0xD7 #define TL1_INIT 0x0C /************************************************************************************************************ * TIMER 0 interrupt subroutine ************************************************************************************************************/ void Timer0_ISR (void) interrupt 1 //interrupt address is 0x000B { TH0 = TH0_INIT; TL0 = TL0_INIT; // GPIO toggle when interrupt } /************************************************************************************************************ * TIMER 1 interrupt subroutine ************************************************************************************************************/ //void Timer1_ISR (void) interrupt 3 //interrupt address is 0x001B //{ // TH1 = TH1_INIT; // TL1 = TL1_INIT; // P12 = ~P12; // GPIO toggle when interrupt //} /************************************************************************************************************ * Main function ************************************************************************************************************/ void main (void) { //TMOD = 0XFF; Set_All_GPIO_Quasi_Mode; TIMER0_MODE0_ENABLE; //Timer 0 and Timer 1 mode configuration // TIMER1_MODE0_ENABLE; clr_T0M; clr_T1M; TH0 = TH0_INIT; TL0 = TL0_INIT; // TH1 = TH1_INIT; // TL1 = TL1_INIT; set_ET0; //enable Timer0 interrupt //set_ET1; //enable Timer1 interrupt set_EA; //enable interrupts set_TR0; //Timer0 run //set_TR1; //Timer1 run while(1) { } } CH552: a 0.3$ 8051 core + USB + Touch Buttons http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65829 2024-03-29T00:49:26+05:30 Just4Fun Hi all,I was curious to try out the CH552 MCU (8051 core + USB 2.0 + Touch Buttons) so I made a little dev board, the CH552 Dragon: All the details to build it are in this page.








Cheers.
How can i send message in other languages ? http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65828 2024-03-29T00:49:26+05:30 Deepkumar I want to send a text message in other than the English language. So please help me. I found by searching that Unicode can be used for this. But I don't know how can I use it. Thank you in advance..... How these timer values are derived? http://www.8051projects.net/plugins/forum/forum_viewtopic.php?65824 2024-03-29T00:49:26+05:30 wounder I have a 8051 micro controller ,it has timer0,1,2,3 with different modes.in timer0,mode0, i got a sample code (as shown below).from that codeTH0_INIT=0xFC //5.0ms@XTAL=12MHz, Period = (10.85/2) ms@XTAL=22.1184MHz TL0_INIT=0x0Fboth TH0,TL0 load with hex values..but could not derive these values from equation below .. (https://exploreembedded.com/wiki/5.8051_Timer_programming) Could you please tell me ,how these hex values derive ??tick = (1/(Fosc/12)tick = 12/Fosc$$ For Fosc == 11.0592Mhz, the tick time will betick = 12/11.0592M = 1.085069444us = 1.085usNow the Timer value for the required delay can be calculated as below.Delay = TimerCount * tickCount = (Delay/tick)RegValue = TimerMax- Count RegValue = TimerMax-(Delay/tick) = TimerMax - (Delay/1.085us)RegValue = TimerMax-((Delay/1.085) * 10^6)$$#include "SFR_Macro.h" #include "Function_define.h" #define TH0_INIT 0xFC //5.0ms@XTAL=12MHz, Period = (10.85/2) ms@XTAL=22.1184MHz #define TL0_INIT 0x0Fvoid Timer0_ISR (void) interrupt 1 //interrupt address is 0x000B{TH0 = TH0_INIT;TL0 = TL0_INIT; P12 = ~P12; // GPIO toggle when interrupt } void main (void) { TMOD = 0XFF; Set_All_GPIO_Quasi_Mode; TIMER0_MODE0_ENABLE; clr_T0M; clr_T1M; TH0 = TH0_INIT; TL0 = TL0_INIT; // set_ET0; //enable Timer0 interrupt //enable Timer1 interrupt set_EA; //enable interrupts set_TR0; //Timer0 run while(1) { TH0 = TH0_INIT; TL0 = TL0_INIT; set_TR0; while(!TF0); clr_TR0; P12 = ~P12; TF0 = 0 ; } }