Pic12f1840 tvbgone code

A place to document your own projects.

Pic12f1840 tvbgone code

Postby exapod » Mon Jul 30, 2012 4:51 am

Hi,
like the title says i have successfully ported the european tvbgone to the PIC12F1840.
For now with only the 6 most diffused code, all the project uses about 17% of the memory program and 13% of the data memory.
I am using the free version of hitec c so the optimization is not very good.
Later this day i will upload a new project with all the code that i can fit on the pic.
For test the code i make a simple board.
Userled is RA4 and the pwm/ir led is RA5.
Finally there is a tvbgone for an 8 pin uc that isn't an avr ;)
Attachments
tvbgone.zip
Source cods
(155.83 KiB) Downloaded 1061 times
IMAG0243.jpg
pic12f board
Last edited by exapod on Mon Jul 30, 2012 4:36 pm, edited 1 time in total.
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby exapod » Mon Jul 30, 2012 4:57 am

Oh, and the pic on my supplier is cheaper than the Attiny85V so :)
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby exapod » Mon Jul 30, 2012 4:48 pm

The hitec complier with big sources codes is acting in a very strange way...it compiles the project with 55 codes and uses something like 65 % of the memory but when i try to compile with 60 codes it doesn't finish the compile and mplab crash.
I'm now tryng to use microchip new compiler XC8 but i don't know if it works under an mplab 8.xx version...
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby phalox » Tue Jul 31, 2012 2:03 am

I love this pic! They're really cheap, you can get them in nearly all packages. I guess this could also fit in the 12F1822 (which has half of the memory or so).

About that compiler, it's really designed to be used for MP lab X. Give it a go, I like it better than MPLab 8 :)

I had an old laser pointer lying around, I might be able to fit all of this in there too! But time... time...
phalox
Newbie
Newbie
 
Posts: 19
Joined: Fri Jul 13, 2012 10:44 am

Re: Pic12f1840 tvbgone code

Postby exapod » Tue Jul 31, 2012 5:10 am

This is the project with 70 codes that should compile without problem beacause it does with 60 codes and the memory used is about 74 % so it shoul fit 70 codes, but when i try to compile it it never ends.
Can someone try it?
And yes thid version should fit the 1822 without problem.
Attachments
tvbgonehitec.zip
Try to compile
(124.66 KiB) Downloaded 706 times
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby phalox » Tue Jul 31, 2012 5:39 am

I tried it with the XC8 compiler and it seems to keep on running there too.

I get this warning: (1273) Omniscient Code Generation not available in Free mode (warning)
Not really sure what causes it!
phalox
Newbie
Newbie
 
Posts: 19
Joined: Fri Jul 13, 2012 10:44 am

Re: Pic12f1840 tvbgone code

Postby exapod » Tue Jul 31, 2012 5:43 am

o.O or is the code or the free version of the compilers, in my pc after i close mplab i have to terminate the cgpic.exe in task manager that uses 50 % of CPU!!
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby phalox » Tue Jul 31, 2012 5:47 am

Oh, I checked again! It seems it compiled just fine now :-) I just imported the project into MPlab X. It did take quite some time.
According to the stats, it consumes 82% of the flash and 9% of the RAM. Let me see what it does when I select the 12F1822 :)
phalox
Newbie
Newbie
 
Posts: 19
Joined: Fri Jul 13, 2012 10:44 am

Re: Pic12f1840 tvbgone code

Postby exapod » Tue Jul 31, 2012 5:59 am

i don't think that it will compile for it, because the 1822 has half the memory so if it was 50 % maybe but it is 82 % so i don't think...
Can you try with more codes, until the memory is completely used, and then share the hex?
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby phalox » Tue Jul 31, 2012 6:07 am

I'm letting it run for the 1822 now. You never know that compiler does some crazy stuff :-)

After lunch I'll get it compiling with more codes. We could try to use the trial version of the XC8 compiler. It should enable optimization and reduce things somewhat more. But nevertheless, the codes should still be stored. and you can't optimize that away!
phalox
Newbie
Newbie
 
Posts: 19
Joined: Fri Jul 13, 2012 10:44 am

Re: Pic12f1840 tvbgone code

Postby exapod » Tue Jul 31, 2012 6:17 am

I tried with the XC8 and after a ---> LOT OF TIME <--- it compile also on my pc :)
I tought about using the trial of the pro version of the compiler but then the code is not very "open" and customizable, but the compiler says that the pro version generate 40 % smaller code than the free so i think i will try and see what happens.
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby phalox » Tue Jul 31, 2012 6:36 am

It just 'finished' compiling for the 12F1822.

../WORLDcodes.h:3975: error: could not find space (138 bytes) for variable _EUpowerCodes
../WORLDcodes.h:3975: warning: object "_EUpowerCodes" lies outside available data space

Memory is full :-) I'll see how many extra we could add...
phalox
Newbie
Newbie
 
Posts: 19
Joined: Fri Jul 13, 2012 10:44 am

Re: Pic12f1840 tvbgone code

Postby exapod » Tue Jul 31, 2012 8:40 am

Thank you very much for the help, at this point i think that is or my pc or the 8.xx version of the mplab.It takes too much time...
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: Pic12f1840 tvbgone code

Postby phalox » Tue Jul 31, 2012 8:49 am

Same here, I canceled compilation because I needed the processing power :-) I don't quite understand why it's taking so long. Putting all the stuff in the right memory locations shouldn't be too hard...
phalox
Newbie
Newbie
 
Posts: 19
Joined: Fri Jul 13, 2012 10:44 am

Re: Pic12f1840 tvbgone code

Postby exapod » Tue Jul 31, 2012 3:18 pm

I really don't understand. it is very strange.
Wow if you search "xc8 never ends compile" on google, one of the first result is this post.
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Next

Return to Project logs