Fantje, vse deluje OK!
Hvala!
↧
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
[b:adfefbf4d4]enniom[/b:adfefbf4d4], I talk about source for included photo. I think about corrupted font & not corrected string addressing.
For this source needed photo to see how it works.
↧
↧
Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY
Yes, MrShilov, the files included in my post are the complete source code that produced the effect shown on the photograph.
↧
BASCOM-AVR : Problem Including Bootloader Code in Application Program : NEWTOPIC
I want to include a compiled bootloader code in to an application program.
This allows factory programming of both in one go as oppose to programming a bootloader and then bootloading the application program
I have been doing this for years with Atmega chips like this:
[code:1:4634eaf7f7]$Boot=$F800
$Inc BootLoader,NoSize,"My_BootLoader.bin" [/code:1:4634eaf7f7]
(My_BootLoader.bin file is a binary image of bootloader code only, compiled with Bascom AVR).
However, this doesn't work with Xmega 256A3U:
[code:1:4634eaf7f7]$Boot=$20000
$Inc BootLoader,NoSize,"My_BootLoader.bin"[/code:1:4634eaf7f7]
I have also tried:
[code:1:4634eaf7f7]$RomStart=$20000
$Inc BootLoader,NoSize,"My_BootLoader.bin"[/code:1:4634eaf7f7]
All I need the compiler to do is to place the code from My_BootLoader.bin file at location $20000
If anyone can help, it would be much appreciated.
[b:4634eaf7f7][color=red:4634eaf7f7](BASCOM-AVR version : 2.0.7.7 )[/b:4634eaf7f7][/color:4634eaf7f7]
↧
BASCOM-AVR : Problem Including Bootloader Code in Application Program : REPLY
you need to add :
! .ORG $the WORD address of the loader
'put the $Inc here
↧
↧
BASCOM-AVR : Inconsistency with Left() : NEWTOPIC
I have inconsistent results with Left((buffer , 4) it works with the If Then but partly with the Select Case
Below if in the Case statement I do as I have in the If Then I do not get to the Print "POSTED" it goes on to the Else but if I assign to Lf it finds it and prints posted but it will still find the first Case "GET " with both so is it that I should always use a variable first?
Regards Paul
[code:1:30c2d7e723]
Redirect = 0 'reset flag
Lf = Left(buffer , 4)
If Left(buffer , 4) = "POST" Then
Print "I FOUND IT"
End If
Select Case Lf ' Left(buffer , 4) does not find "POST"?????
Case "GET "
'#if Cdebug
Print "found GET "
'#endif
La = 0
La = Instr(buffer , "?")
'Print "La>" ; La
If La > 0 Then 'a command has been sent
Redirect = 1 'we will need redirection
Print "set something"
Bcmd = 4
Call Decode
Call Find_page()
Else 'just send a page
Bcmd = 1 ' GET /index.htm HTTP/1.1
Call Find_page()
End If
Case "HEAD"
Bcmd = 2
Call Find_page()
Case "POST"
Print "POSTED"
Bcmd = 3
Tempw = Instr(buffer , "Content-Length:" ) ' for post
Tempw = Tempw + 16
Ls = Mid(buffer , Tempw , 1) 'only working with short length 0-9
Bcontent = Val(ls)
#if Cdebug
Print "the value is>" ; Bcontent
#endif
Postdta = Right(buffer , Bcontent )
'#if Cdebug
Print "the posted data is >" ; Postdta
'#endif
Case Else
Print "NO FIND"
#if Cdebug
Print Buffer ' print data the client browser sent
#endif
End Select
[/code:1:30c2d7e723]
[b:30c2d7e723][color=red:30c2d7e723](BASCOM-AVR version : 2.0.7.7 )[/b:30c2d7e723][/color:30c2d7e723]
↧
BASCOM-AVR : Problem Including Bootloader Code in Application Program : REPLY
Thank you for your help Mark.
Unfortunately, it didn't quite work. While the compiler placed the bootloader code at the right address,
it also placed a lot of data, including application program constants, after the bootloader code.
It also generated an error message: "Program will overwrite bootloader...." as the compiler is not aware
that the code following ! .ORG $20000 is a bootloader code.
I have tested the code with Ver 2.0.7.7 and it works fine with Atmega chips:
[code:1:0fe483b17c]$Boot=$F800
$Inc BootLoader,NoSize,"My_BootLoader.bin"[/code:1:0fe483b17c]
Is there a reason why it shouldn't work with Xmega chips?
↧
BASCOM-AVR : Problem Including Bootloader Code in Application Program : REPLY
Did you use the [b:afa0466e2f]$LOADERSIZE[/b:afa0466e2f] option in your main program?
↧
BASCOM-AVR : Problem Including Bootloader Code in Application Program : REPLY
Just tried using $LoaderSize in main program but it made no difference.
It's not the error that's the problem as the compiler still generates HEX and BIN files.
It's the fact that the compiler stores constants and other data from the main program
after the bootloader code. This makes the total size of the file bigger than can fit in to flash.
This makes sense (to me) as the compiler is not aware that code following $20000 is a bootloader
and treats it as part of the main program.
↧
↧
BASCOM-AVR : Problem Including Bootloader Code in Application Program : REPLY
please post an example that works for you with atmega. (with all files).
and also a sample for xmega. the inc file can be rubbish, and the main program can be minimal, but i need some real code to look at that contains your used settings.
↧
BASCOM-AVR : Inconsistency with Left() : REPLY
please post some code that can be checked. CASE works different compared to IF since CASE only loads the address once. But when you include a function, i suspect the pointer is changed.
↧
Share your working BASCOM-AVR code here : Using the 23S17 as portexpander : NEWTOPIC
Hallo allemaal.
Voor een woordklokje waarvan ik het idee van Ben's Hobbycorner heb geleend en de software trouwens ook grotendeels, heb ik zelf een ontwerp gemaakt op basis van een ATMega1284P. Met te weinig IO's voor een grafisch display inderdaad. Na enige zoeken kwam ik bij de 23S17 als portexpander terecht. Aansturen met SPI en je hebt 16 pinnetjes om als input of output te gebruiken. Allerlei leuke trucen zijn in dat ding aanwezig. Printje ontworpen en na 3 weken kon ik solderen ... En hoera, slechts twee dommigheden op de print die gelukkig makkelijk te fixen waren. In alle blijdschap Ben ook twee exemplaren gestuurd. En die zei: Van die portexpander moet je een tutorial maken. En dat heb ik dan ook gedaan. In het bijgaande PDF'je twee voorbeelden van het gebruik om te schrijven (kipsimpel) en te lezen (zo, dat duurde even voordat ik de truc doorhad). Het e.e.a. is gedocumenteerd en in het Engels om ook de gasten hier wegwijs te maken.
Ben: Superbedankt voor alle hulp, de software, het idee ... Alles!
Hi all,
I lended the idea of a "word clock" from Bens Hobbycorner. Made a different schema, designed a PCB for it and three weeks later it came with the mailman. I used a portexpander using the SPI port, the 23S17. Using it in the "word clock" was quite simple, only used as output ports. Ben advised me to make a tutorial, so I did. In the enclosed PDF two examples, one for using as output pins, and one for reading pins. All well described (I hope).
Hopefully this is usefull for anybody, if not, it kept me home for two days experimenting and writing these examples. :P
Thanks all for contributing to this forum, this is truly helpfull!!!!
Kees
↧
Share your working BASCOM-AVR code here : LCD menu with UI designer : REPLY
This is realy an amazing application!
Sadly I don't understand how to use it yet...
I would like to create a menu structure with several layers which can write values, call functions while being operated by 4 buttons (enter, back, up, down)
On the wiki page I've read about the functions of the lcd designer but I don't know where to start and how to set up the menu structure.
Can anyone point out the right direction for me?
Thanks!
↧
↧
Share your working BASCOM-AVR code here : Using the 23S17 as portexpander : REPLY
Hello Kees,
thank you for taking the time to document and share with us. It is very clear. A nice chip indeed.
↧
Share your working BASCOM-AVR code here : Using the 23S17 as portexpander : REPLY
With the PCB Kees made, the finished clock looks like this
[img:f46eaaab9f]http://members.home.nl/hobbycorner/images/klok_front.jpg[/img:f46eaaab9f]
[img:f46eaaab9f]http://members.home.nl/hobbycorner/images/klok_zijkant1.jpg[/img:f46eaaab9f][img:f46eaaab9f]http://members.home.nl/hobbycorner/images/klok_zijkant2.jpg[/img:f46eaaab9f]
Have fun
Ben Zijlstra
↧
Share your working BASCOM-AVR code here : Using the 23S17 as portexpander : REPLY
ha, i just found a great surprise email which i answered 1 minute ago :-)
really great guys! And blue happen to be my favorite color, but i guess you knew that?
↧
BASCOM-AVR : Inconsistency with Left() : REPLY
This may not be a solution, but I found that its safer to parse incoming strings using INSTR rather than LEFT or MID functions. Then leading junk on the string is ignored, rather than causing a false negative.
Eg if looking for "POST" in the string buffer, use
dim btemp as byte
btemp = INSTR(buffer,"POST")
if btemp > 0 then
'Post will be detected here, even if the buffer contains "xxxPOSTyyy"
end if
Means you cannot use SELECT...CASE, but it seems better for other reasons.
↧
↧
BASCOM-AVR : Inconsistency with Left() : REPLY
Hello Mark , Adrian
Mark it was first a question if I was using the select case correctly before I tried to make some smaller code sample but with this web-server code nothing is small I will try to make a sample to test it out.
Adrian yes I agree and I may even change this code, but I was first working with the example I started with that Ben posted I was moving from using Get to POST in the web pages I already had from other work, so the sub that I parse the string with to find the data sent was what I was working on (using Instr) but it was not getting called even though GET was, so finally after putting in lots more prints I could see it was not being picked up in the select case and I then thought maybe I am using it incorrectly. Its now working as expected and I am getting what is sent as data by the POST and I can move on to change all the pages.
Regards paul
↧
Share your working BASCOM-AVR code here : NOKIA-3310/5110 LCD library : REPLY
Some further research finds that that Mr. Mark Alberts commented:
[quote:0c50a8dfda]These are registers R21 and R22. The xmega can not linear address these registers. But you can use bascom SETREG statement. Or use some asm with STS.[/quote:0c50a8dfda]
in this thread [url]http://mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=12098&start=0&sid=3ebf35b023115f2ecc44638f1ab10ca2[/url]
Could this comment be the reason why the font lookup portion of the Library posted by MrShilov (which seems to use these registers) does not find the correct characters??
↧
BASCOM-AVR : ATXMEGA USART problem : NEWTOPIC
Hi,
What is wrong on this code: ???
[code:1:bd92cf5f4e]' **********************************************************
$regfile = "xm32E5def.dat"
$crystal = 32000000
Config Osc = Enabled , 32mhzosc = Enabled
Config Com2 = 1000000 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8 ' <- here is error with Com2 on PC7
Open "com2:" For Binary As #1
' **********************************************************[/code:1:bd92cf5f4e]
It gives me error on COM2 USART on port PC6/PC7. COM1 and COM4 is OK
Thanks
[b:bd92cf5f4e][color=red:bd92cf5f4e](BASCOM-AVR version : 2.0.7.7 )[/b:bd92cf5f4e][/color:bd92cf5f4e]
↧