Hi everyone !
I try to read the TMR0 register value but it seems it doesn't work.
The value keeps always 0
My Cfg :
- Windows 10
- FlowCode v8.2.2.15 (2020-02-28)
PIC10F322 - reading the TMR0 register value
Moderator: Benj
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC10F322 - reading the TMR0 register value
You won't be able to read SFR values within simulation unless using Ghost hardware, E.g Flowkit2 or Multiprogrammer
It will work on your hardware i.e will contain the value of
It will work on your hardware i.e
Code: Select all
tmr0_valueCode: Select all
TMR0
Last edited by medelec35 on Sat May 02, 2020 10:25 am, edited 1 time in total.
Reason: Deleted incorrect information.
Reason: Deleted incorrect information.
Martin
Re: PIC10F322 - reading the TMR0 register value
It would be nice having a message in Flowcode which tell us this limitation !medelec35 wrote:You won't be able to read SFR values within simulation unless using Ghost hardware, E.g Flowkit2 or Multiprogrammer
It will work on your hardware i.ewill contain the value ofCode: Select all
tmr0_valueSimulation will not work with any manually added C Code blocks.Code: Select all
TMR0
Windows 10.0.18362.778
Flowcode v8.2.2.15 (2020-02-28)
Flowcode v8.2.2.15 (2020-02-28)
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC10F322 - reading the TMR0 register value
Sorry that's not totally true now with Flowcode V8medelec35 wrote:Simulation will not work with any manually added C Code blocks.
It can simulate C code blocks, but its using the conventional code like if() etc.
It can't simulate the code that's directly reading from the FSR.
With any software it normally list the things it can do.
It would be impracticable to list everything software can't do.
For example you seen the size of the latest PIC datasheets?
If its not listed on the information downloads or website and you want to do it then its always best to install a trial version or ask the question prior to installing.
Re reading SFR.
What I do is send the value via UART to A terminal program like Terra Term.
Or if not got Comms package send to LCD if enough pins are available.
Martin
Re: PIC10F322 - reading the TMR0 register value
I don't understand Martin.
I have tried to follow this wiki article as example which speaks about "custom interrupt" :
https://www.flowcode.co.uk/wiki/index.ph ... -_PICmicro
As we can see, it seems there is a way to get directly values from PIC SFR.
So where is the trouble ?
I have tried to follow this wiki article as example which speaks about "custom interrupt" :
https://www.flowcode.co.uk/wiki/index.ph ... -_PICmicro
As we can see, it seems there is a way to get directly values from PIC SFR.
So where is the trouble ?
Windows 10.0.18362.778
Flowcode v8.2.2.15 (2020-02-28)
Flowcode v8.2.2.15 (2020-02-28)
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC10F322 - reading the TMR0 register value
That code is for reading from 16bit registers, you already know the code for 8 bits.
What I stated still applies:
Custom interrupts and the following reading in to a Flowcode variable was solely for hardware and not for simulation.
I guess it would be better if that was stated within the text.
What I stated still applies:
So can only simulate generic C code and not PIC registers.medelec35 wrote:It can simulate C code blocks, but its using the conventional code like if() etc.
It can't simulate the code that's directly reading from the FSR.
Custom interrupts and the following reading in to a Flowcode variable was solely for hardware and not for simulation.
I guess it would be better if that was stated within the text.
Martin
Re: PIC10F322 - reading the TMR0 register value
Thanks for the reply Martin
I have checked the wiki and it is not specified that it can't directly read SFR.
https://www.flowcode.co.uk/wiki/index.ph ... Simulation
PS : I had forgotten to activate the "C Simulate" feature by clicking on the icon.
I have well a message box which indicates that "TMR0" is not recognized.
I have checked the wiki and it is not specified that it can't directly read SFR.
https://www.flowcode.co.uk/wiki/index.ph ... Simulation
PS : I had forgotten to activate the "C Simulate" feature by clicking on the icon.
I have well a message box which indicates that "TMR0" is not recognized.
Windows 10.0.18362.778
Flowcode v8.2.2.15 (2020-02-28)
Flowcode v8.2.2.15 (2020-02-28)
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC10F322 - reading the TMR0 register value
is related toDeeJayOne wrote:"TMR0" is not recognized.
&medelec35 wrote:So can only simulate generic C code and not PIC registers.
medelec35 wrote:You won't be able to read SFR values within simulation
Martin