Quantcast
Channel: MCS Electronics Forum
Viewing all 20688 articles
Browse latest View live

Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY

$
0
0
i test the library on xmega32a4 and also some other lcds,it is very strange that some times lcd start to work and some times not working, and all other lcds are too! i search bascom help and found : [quote:89bead6aea]The XMEGA has a built in internal oscillator that runs at a relative slow speed. If your code sets the speed to 32 MHz and you also include the $crystal=32000000 directive, you will notice a delay in the start of the code. This is caused by the fact that the delay routines are calculated with the 32 Mhz frequency, but the actual oscillator speed is 1 or 2 MHz. There are 2 solutions possible. - you can use $crystal=1000000 and then after you have set up the clock speed with CONFIG OSC, you can use another $CRYSTAL directive with the new speed. - you use $INITMICRO and put the CONFIG OSC in the _INIT_MICRO code. This will ensure that the micro will run at the specified speed early as possible. [/quote:89bead6aea] and do it,but problem exist yet! the code: [code:1:89bead6aea]$regfile = "xm32a4udef.dat" $crystal = 32000000 $hwstack = 256 $swstack = 256 $framesize = 256 '------------------------------------------------------------------------------- $lib "xmega.lib" : $external _xmegafix_clear : $external _xmegafix_rol_r1014 Config Osc = Disabled , 32mhzosc = Enabled , 32khzosc = Enabled Bitwait Osc_status.1 , Set Bitwait Osc_status.2 , Set Osc_dfllctrl = &B00000000 Set Dfllrc32m_ctrl.0 Osc_pllctrl = &B10_0_01000 Set Osc_ctrl.4 Bitwait Osc_status.4 , Set Config Sysclock = Pll , Prescalea = 1 , Prescalebc = 1_2 Waitms 2 '------------------------------------------------------------------------------- Config Vport0 = D $lib "glcd-Nokia3310.lib" Config Graphlcd = 128x64sed , A0 = Port0.2 , Si = Port0.1 , Sclk = Port0.0 Initlcd Config Portd.0 = Output Config Portd.1 = Output Config Portd.2 = Output Setfont Font6x8 Do Cls Lcdat 1 , 1 , "--------------" Lcdat 2 , 1 , "--------------" Wait 1 Cls Lcdat 1 , 1 , "**************" Lcdat 2 , 1 , "**************" Wait 1 Loop End $include "font6x8.font" '------------------------------------------------------------------------------- [/code:1:89bead6aea] what do you think about my problem? Regards

Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY

Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY

$
0
0
i dont put reset pin connected to micro, and now i can not change the pcb. is there any other way? thanks

Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY

$
0
0
If Reset pin connect to Vcc directly, LCD may not start. It must be connect to Vcc with resistor 10k and with capacitor 1mk to GND. Try to add delay 100ms before Lcdinit.

BASCOM-AVR : EEprom access using pointers and tables : REPLY

$
0
0
Thanks Mark, no desperate hurry. I can live with how I do it now, but certainly would make some handling of eeprom settings very much simpler and easier to maintain.

BASCOM-AVR : Attiny 13 problem with PB : REPLY

$
0
0
I use sometimes RST pin in 8PIN Tiny`s as OUTPUT/INPUT because I have [b:0283b142af]FuseBit Doctor[/b:0283b142af]. This free hardware allow you to reprogram Fuses in any AVR quicly and even without PC :D This is HVPP programmer based on Atmega8/328P For Tiny`s can be build quick because only fiew pins are used and needed ;) Very simple and helpfull tool.

BASCOM-AVR : Attiny 13 problem with PB : REPLY

$
0
0
Found a link... that is very good information http://mdiy.pl/atmega-fusebit-doctor-hvpp/

Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY

$
0
0
i use 10k and 1mf but the resault is same. also for sure i connect the reset pin to micro and use it in program and the resault is same. also i use a 2x16 character lcd and the resault is same. some times program start and some times it dont start! and when i delete every lcd command from my program, it start immediately! i am sure that it is not related to library and it is related to problem of some instruction that related to lcd, with the registers of xmega! may be Mark know about it and could help me. thanks

BASCOM-AVR : Problem of Xmega with config lcd : NEWTOPIC

$
0
0
Hi I read all the post related to problems of Xmega and the help of bascom related to config osc and $crystall directive, but still i have problem with lcd. as mentioned in help: [quote:5c584db228]The XMEGA has a built in internal oscillator that runs at a relative slow speed. If your code sets the speed to 32 MHz and you also include the $crystal=32000000 directive, you will notice a delay in the start of the code. This is caused by the fact that the delay routines are calculated with the 32 Mhz frequency, but the actual oscillator speed is 1 or 2 MHz. There are 2 solutions possible. - you can use $crystal=1000000 and then after you have set up the clock speed with CONFIG OSC, you can use another $CRYSTAL directive with the new speed. - you use $INITMICRO and put the CONFIG OSC in the _INIT_MICRO code. This will ensure that the micro will run at the specified speed early as possible. [/quote:5c584db228] with 2x16 lcds the problem solved, but using nokia5110 lcd with Mr.Mirshv library and so on, when i use lcd statement, the micro some times start to work and some times not stat to work! what should i do? Regards [b:5c584db228][color=red:5c584db228](BASCOM-AVR version : 2.0.7.8 )[/b:5c584db228][/color:5c584db228]

BASCOM-AVR : Problem of Xmega with config lcd : REPLY

$
0
0
for more information please refer to : [url]http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=12163&start=75[/url] [url]http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=10528&postdays=0&postorder=asc&highlight=xmega+fuse+bit&start=0[/url]

BASCOM-AVR : Im need BootLoader for M164PA and 644p : REPLY

BASCOM-AVR : I2C op m328(arduino nano) : NEWTOPIC

$
0
0
i made a program for my robot mower, it works wel on a m32 but on a m328(aduino nano) the I2C connection wont work, any idee? i work with bascom avr ide (2.0.7.1) and i program it with a kamprog for avr via isp. [b:6f68dfe9d9][color=red:6f68dfe9d9](BASCOM-AVR version : 2.0.7.1 , Latest : 2.0.7.8 )[/b:6f68dfe9d9][/color:6f68dfe9d9]

BASCOM-AVR Old versions : I2C op m328(arduino nano) : REPLY

$
0
0
please check that portc.4 and portc. 5 are connected to the right pins. (measure from pin 27 en 28) of the processor to the SDA and SCL. also check if there is a pull up on the bus. if not you could activate the internal pull up by writing a 1 to scl and sda pins. i notice you use the software i2c while the micro has a TWI. You best check CONFIG TWI and the samples in order to use the TWI. You already use the twi pins.

BASCOM-AVR : Xmega256D3 and TWIE compilation error : REPLY

$
0
0
[quote:3ef0be97c6="laborratte"]...config TWI[b:3ef0be97c6]E[/b:3ef0be97c6] = .... Read help "config twi" for details[/quote:3ef0be97c6] Hello Laborratte. Thanks very much for your suggestion. I eventually found the problem to be more basic in that there are some omissions in the xm256D3def.dat file. TWIC is defined completely, but there is some stuff missing for TWIE. (An cryptic remark was in the datasheet errata that suggests the reference to TWIE had been missing in earlier revisions of the documentation.) Missing in 'xm256D3def.dat' is the definition of the addresses and the definition of the interrupt names. I took these from the xm128A1def.dat file and added them to xm256D3def.dat. So i added: ;*************************************************************************** ;** TWIE - Two-Wire Interface E ;*************************************************************************** TWIE_CTRL = 1184 ; TWI Common Control Register TWIE_MASTER_CTRLA = 1185 ; Control Register A TWIE_MASTER_CTRLB = 1186 ; Control Register B TWIE_MASTER_CTRLC = 1187 ; Control Register C TWIE_MASTER_STATUS = 1188 ; Status Register TWIE_MASTER_BAUD = 1189 ; Baud Rate Control Register TWIE_MASTER_ADDR = 1190 ; Address Register TWIE_MASTER_DATA = 1191 ; Data Register TWIE_SLAVE_CTRLA = 1192 ; Control Register A TWIE_SLAVE_CTRLB = 1193 ; Control Register B TWIE_SLAVE_STATUS = 1194 ; Status Register TWIE_SLAVE_ADDR = 1195 ; Address Register TWIE_SLAVE_DATA = 1196 ; Data Register and INTname45=TWIE_SLAVE,$005A,#TWIE_SLAVE_CTRLA.6, INTname46=TWIE_MASTER,$005C,#TWIE_MASTER_CTRLA.6, (These were listed as 'reserved' before..) Now my code compiles fine! (I have tested for proper working yet!) Thanks again and best wishes, poesboes

BASCOM-AVR : CANOpen : NEWTOPIC

$
0
0
hi A year or so ago there was a post regarding Bascom AVR and CANOPEN Well - depending on what you need to do it is quite possible and very easy to get working. I have a few boards with Can128 used as inputs and outputs in a Festo and Schneider PLC running CODESYS . One need to create a XX.EDS file with the configuration of the board so best is to start with a similar type of product and edit it for own use and need to 'clone ' an existing user / manufacturer ID , for development or private use . The idea is not to implement a full CANopen stack - or use it in safety critical devices , but at least the basic objects to control the board and get data to and from it. Once the node is activated with a few commands , the data is sent as required. It can even be active after sw-on so then you do not even need to have the node activation code to start sending / receiving data . It is also then very easy to expand and add more CANOPEN functions or options as needed . We use it as an absolute magnetic encoder with a AS5600 and also for 4-20 mA input and valve output - incl PWM , 8 nodes running Bascom with 3 Schneider VFD units , 11 nodes total in the one system . All that with a 4ms update rate The can implementation of Bascom AVR make it super easy to do this. [b:fbc8689308][color=red:fbc8689308](BASCOM-AVR version : 2.0.7.8 )[/b:fbc8689308][/color:fbc8689308]

BASCOM-AVR Old versions : I2C op m328(arduino nano) : REPLY

$
0
0
Hello geertie What was the crystal frequency of the M32 Try Config I2cdelay = 40 Regards Paul

BASCOM Project Blog : Building a Webserver with a Wiznet W5100 : REPLY

$
0
0
Hi Paul. I watch your work and I`m impressed. I build custom Arduino shield for my friend. On this shield we have 3x MAX31855 for thermocuples, 1Wire sensor and Bus out for next devices, MAX232 for communication with CP08MHT80, DS1307 RTC and HX711 for weight. On the top of this shield fit Arduino Ethernet shield so my shield is in the middle :P All paramaters are logged to SD CARD as "Log.txt" Because building is a little bit away from home we want to use LAN cable instead WiFi. Now i have a question. If there is a ready solution to generate server/site with button for "download" this "Log.txt" file? How AVR should handle this? :D Should read line by line and send it or what :D Better to ask than to sit and re-invent the wheel again, I think :D

Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY

$
0
0
I check library on Atxmega256A3BU with this config: [code:1:baf333d023]$regfile = "xm256a3budef.dat" $crystal = 32000000 $hwstack = 100 $swstack = 100 $framesize = 100 Const Mul_pll = _xtal / 2000000 Config Osc = Enabled , Pllosc = Enabled , Pllsource = Rc2mhz , Pllmul = Mul_pll Config Sysclock = Pll , Prescalea = 1 , Prescalebc = 1_1 '******************************************************************************* $lib "glcd-Nokia3310.lib" Config Vport3 = F Config Portf = Output Config Graphlcd = 128x64sed , A0 = Port3.2 , Si = Port3.3 , Sclk = Port3.4 Const Contrast_lcd = 68 Const Negative_lcd = 0 ' Inverting screen Const Rotate_lcd = 0 ' Rotate screen to 180°[/code:1:baf333d023] It starts and works fine up to 50MHz. For 52MHz and higher it need to add delay in "_gwrite_datamisc" routine: [code:1:baf333d023]_gwrite_datamisc: push r23 *#If varexist("_GLCD_PORT_CS1") * cbi _GLCD_PORT_CS1,_glcd_cs1 ; enable chip - CS=0 #Endif nop ; ---------- added delay !!!!!!!! nop ; ---------- added delay !!!!!!!! ldi r25,8 ; 8 bits _gwrite_datamisc8: ... [/code:1:baf333d023] Maybe your LCD slower than my and need this delay (you can use "@genus(1)" against "nop"). Also try to increase existed delays "@genus(1)" to "@genus(2)" or more.

BASCOM Project Blog : Building a Webserver with a Wiznet W5100 : REPLY

$
0
0
Hello EDC I have not implemented the file transfer protocol but others have SIX1 has and others so adapting theirs could be done With what I have implemented you can just type the file name then the server will send it to you I have also built a couple of boards to plug in the Ethernet shield these use the m1284p because of its 16K of ram I think the next version of the board will be a production one They have inbuilt switch mode regulator , max3232 If possible it would be good if you can post your code to add to what I have done Post here in the blog that keeps all the server code together I try to make my code modular so it can be put together as blocks you only use the blocks you need. I have just put together the code to create a DNS request its not yet tested but it does put the bytes together correctly and it is a function so you just send it the URL it does the rest so only need to load the buffer and send it Now have to handle the return from server.

BASCOM Project Blog : Building a Webserver with a Wiznet W5100 : REPLY

$
0
0
you can post a txt file. just include it with a link like you include an image. then you can use 'save link as' and when the user click the link, you send the data. have a look at the webserver demo from the tcpip folder. it works the same for images, txt, html or whatever you send.
Viewing all 20688 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>