View previous topic :: View next topic |
Author |
Message |
dabatek
Joined: 31 Jul 2013 Posts: 32 Location: Serbia
|
Posted: Mon Feb 29, 2016 7:44 pm Post subject: ADC in AVR simulator |
|
|
Hi,
ADC work strangely in AVR simulator...
With set a value for each channel by selecting the desired channel
below the track bar - work OK. But in IO window - registers ADCH and ADCL constantly have value 0,
assigned variable for desired adc channel is OK like in track bar.
Next problem is in Real hardware Simulation - any voltage on real adc pin is not presented in simulator only work
track bar.
I tried to find something about it in help file but nothing.
Some help about this...
ZD
(BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.7.8 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon Feb 29, 2016 9:03 pm Post subject: Re: ADC in AVR simulator |
|
|
dabatek wrote: | But in IO window - registers ADCH and ADCL constantly have value 0 |
Ok, but who cares...
Such would be only useful, if you'd directly access these registers.
Quote: | assigned variable for desired adc channel is OK like in track bar. |
That should do it.
Quote: | Next problem is in Real hardware Simulation - any voltage on real adc pin is not presented in simulator only work
track bar. |
Where did you get the simulator connects to real hardware? |
|
Back to top |
|
|
dabatek
Joined: 31 Jul 2013 Posts: 32 Location: Serbia
|
Posted: Mon Feb 29, 2016 9:39 pm Post subject: |
|
|
From help file Page 101:
Enable Real Hardware Simulation
By clicking the button ___ you can simulate the actual processor ports in-circuit!
The processor chip used must have a serial port.
In order simulate real hardware you must compile the basmon.bas file...
This works OK and normal not with time critical periphery units... , maybe ADC is problem... |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon Feb 29, 2016 10:02 pm Post subject: |
|
|
If you read the help, you'll notice basmon is all about simple portpin and direction control via serial, usable for driving a lcd display, not usable for higher speeds, understandable at 19200 baud.
There's nothing written about reading the ADC either, which basically should be no problem to read and simulate.
Guess nobody requested it and so it was likely not implemented. |
|
Back to top |
|
|
dabatek
Joined: 31 Jul 2013 Posts: 32 Location: Serbia
|
Posted: Mon Feb 29, 2016 10:42 pm Post subject: |
|
|
Some time ago I used ATMEl ICE 200 - in circuit emulator (bascom .dbg file and A.studio 4)
This emulator was work Ok with ADC on very slow speed.
So I was hoping that this is possible with Bascom real hardware sim.
All of this I need because I must work with AVR ADC registers directly and it work ok now. I have full desired speed and controll to ADC,
but sometime I need some testing with Bascom simulator...
OK, I can find some other way...
Thank you for your patience |
|
Back to top |
|
|
dabatek
Joined: 31 Jul 2013 Posts: 32 Location: Serbia
|
Posted: Mon Feb 29, 2016 10:43 pm Post subject: |
|
|
Sory no .dbg file it is .obj file |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Mon Feb 29, 2016 10:48 pm Post subject: |
|
|
If you want to simulate and debug on real hardware, then you need something like AVR Studio. Its a big beast, but it does work.
The Bascom simulator is excellent for testing software, paticularly routines and programming ideas which need running to see how ( or if ) they work.
Hardware testing needs real hardware, and most often running at real processor speeds. No software emulator can do that effectively. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
dabatek
Joined: 31 Jul 2013 Posts: 32 Location: Serbia
|
Posted: Mon Feb 29, 2016 11:24 pm Post subject: |
|
|
Yes I agree,
but with atmel studio 4 and bascom .obj file this work ok.
These days I tested with JTAGICE3 and of course I must use newer version of a.studio
but .obj from bascom not doing more like in a.studio 4. |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Tue Mar 01, 2016 11:19 pm Post subject: |
|
|
I have to admit that I cannot stand AVR Studio 6. Never got as far as trying it on a Bascom .obj file, could not get it to recognise my JTAG, never mind anything else. I keep an old PC running Win XP, and run AVR Studio 4 on that. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
|